문제

I'm using msbuild to automatically build and package a website ready for deployment. When I compile and then Publish my project through Visual Studio 2008 everything works fine.

However when I use msbuild I'm getting errors because AspNetCompiler is trying to compile aspx and ascx files that are not included in my .csproj, but still exist in version control.

I know I can just remove them from version control, but can anyone tell me why these files are being compiled?

Here is my msbuild task.

    <AspNetCompiler                
     TargetPath="$(PackageDir)\Web"
     VirtualPath="/"
     PhysicalPath="$(buildDirectory)\Web"
     Force="true"
     />

Thanks!

도움이 되었습니까?

해결책

The AspNetCompiler task, which wraps _aspnet_compiler.exe_, compiles all "compilable" files in the application, rather than compiling only those files in the .csproj.

The giveaway is that none of the command-line parameters for the executable take a .csproj as input, only paths. (I suppose one could argue that it would look for a .csproj in the directory, but that is unlikely as it would introduce its own set of issues, such as what to do if someone had put two project files in one directory.)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top