我正在尝试使用自定义 msbuild 文件中的AspNetCompiler任务来预编译 asp .net 4.0 网站。但是,当我运行时:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe custom.msbuild /t:PrecompileWeb
它使用 v2.0.50727 aspnet_compiler。有没有办法强制它使用 v4.0.30319 aspnet_compiler?我问的原因是因为我收到了这个错误:
ASPCONFIG: Unrecognized configuration section system.web.extensions.
但是,如果我运行:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -p .\My.Web.Site -f .\.PRECOMPILATION -v /
它运行良好,这是有道理的,因为我在 web.config 中使用 system.web.extensions 而 2.0 aspnet_compiler 不知道那是什么。