我正在构建服务器中构建/打包一个 Web 应用程序,但它失败并显示以下消息:
I'm building/packing a web application in a build server, and it fails with the following message:
ASPNETCOMPILER 错误 ASPCONFIG:CodeDom 提供程序类型Microsoft.VisualC.CppCodeProvider,CppCodeProvider,版本=10.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 不能位于.
ASPNETCOMPILER error ASPCONFIG: The CodeDom provider type "Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" could not be located.
这是构建服务器环境:
它是一个 ASP MVC 4 Web 应用程序,面向 .NET 4.5.
It is a ASP MVC 4 web application, targeting .NET 4.5.
构建配置包括使用 MSBuild 构建解决方案,并将其部署到包中,以便稍后发布.
The build configuration consists in building the solution with MSBuild, and deploying it to a package, so I can publish it later.
通过TeamCity的日志可以看到MSBuild运行aspnet_compiler.exe
时出现的错误.
Through the log of TeamCity, I can see the error arising when MSBuild runs aspnet_compiler.exe
.
在我的 DEV 机器上构建没有问题,也可以毫无问题地将其发布到本地 IIS.
The builds with no problem in my DEV machine and can also publish it to a local IIS without problems.
有谁知道是什么导致了这个问题?
Does anyone know what may be causing this issue?
更新
在下面查看我的答案.
对我来说,这个错误是在 VS2017 构建 web 项目时弹出的.修复是使 node_modules 目录隐藏在文件资源管理器中.显然,这会阻止 ASP.NET 编译器扫描所有这些文件,从而防止错误.
For me this error was popping up in VS2017 when building the web project. The fix was to make the node_modules directory hidden in File Explorer. Apparently this stops the ASP.NET compiler from scanning all these files and thus prevents the error.
这篇关于Web 应用程序构建错误:无法找到 CodeDom 提供程序类型 Microsoft.VisualC.CppCodeProvider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!