ASP.Net 4.0 - Add Custom Task To Build
I'm using VS2010 and writing an ASP.Net 4.0 app. I'm using DataServices and there's an annoying bug where the compiler every once in a while can't compile suc开发者_如何学JAVAcessfully unless you make some sort of modification to the *.cs file that has the definition of the DataService class.
So, I want to add a step to the beginning of the ASP.Net build process that will modify the file with some arbitrary change before the compilation process starts.
Any ideas?
Thanks
Using the Solution Explorer, right click on the project file, select Properties, then go to the Build Events tab.
In the box for the prebuild command line you can do your prebuild task. You could do something as simple as a xcopy, or if you need to do some pre-processing of a file you can invoke a batch script or executable to do it. You also have a bunch of substitutable properties available to you if you click on the Edit Pre-build button and expand the Macros section.
arg.... just realized that I created this as a Web Site project rather than a Web Application. Ooooops. That's the source of the problem.
精彩评论