views:

293

answers:

0

I'm in the midst, after many hours of researching how to automate the build process, writing a nAnt build script for a project that works with COM interop (not by choice... just the only way to integrate with the host package).

I'm trying to figure out, one of my dll's happens to contain a Linq to SQL class in it, and I'd like to, if at all possible, not call MSBuild or use the Visual Studio environment to build the dll. Has anyone figured out how to correctly compile a Linq to SQL Classes type dll using NAnt and csc tasks exclusively?

I know there was a gentleman that figured out how you do it for the Entity Data Model, and I'm hoping that someone has something similar to that for the Linq to SQL classes.


  <ItemGroup>
    <Compile Include="CardSettings.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="CardSettings.Designer.cs">
      <DependentUpon>CardSettings.cs</DependentUpon>
    </Compile>
    <Compile Include="GiftCard.designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>GiftCard.dbml</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
      <DependentUpon>Settings.settings</DependentUpon>
    </Compile>
    <Compile Include="Provider.cs" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="CardSettings.resx">
      <DependentUpon>CardSettings.cs</DependentUpon>
    </EmbeddedResource>
    <None Include="GiftCard.dbml.layout">
      <DependentUpon>GiftCard.dbml</DependentUpon>
    </None>
  </ItemGroup>
  <ItemGroup>
    <None Include="app.config" />
    <None Include="GiftCard.dbml">
      <Generator>MSLinqToSQLGenerator</Generator>
      <LastGenOutput>GiftCard.designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </None>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
  </ItemGroup>

Ok... so I finally opened my CSProject file and took a look at how the XML is built for the MSBuild program... I see that they are running a custom task (MSLinqToSQLGenerator) that seems to be rendering the Linq XML declarations out in a specific way.

Has anyone been able to call the generator from nAnt, or am I stuck calling MSBuild?

If I'm stuck calling MSBuild, I think I'm just going to convert over 100% to MSBuild going forward, and then slowly convert existing projects over... what a shame.