How do I regenerate a DataContext.designer.cs file from a CC.Net build script
We use Linq2Sql and CruiseControl.NET. Visual Studio likes to rebuild the register any layout change on the DBML designer as a change to the DBML. This forces it to regenerate the DataContext.designer.cs and DataContext.layout files. This, in turn, causes spurious conflicts with Subversion when we go to commit.
I would li开发者_如何学编程ke to svn:ignore the .designer.cs and .layout files to avoid the conflicts, and let our CI server generate them as part of the build process. MSBuild, which works well for building the rest of our project, does not generate the .designer.cs files.
Normally, those files are built upon save of the .DBML within Visual Studio using the custom tool MSLinqToSQLGenerator. I need to be able to do it unattended without running Visual Studio.
How do I do this?
Based mostly on this question, but also this question, this question and my own experience, I don't think it's possible without a lot of ugliness, pain or without converting your LINQ to SQL code generation over to T4 (not appealing, IMO).
精彩评论