Web Application Build Error: The CodeDom provider type Microsoft.VisualC.CppCodeProvider could not be located

Arthur Nunes picture Arthur Nunes · Dec 12, 2013 · Viewed 28.5k times · Source

I'm building/packing a web application in a build server, and it fails with the following message:

ASPNETCOMPILER error ASPCONFIG: The CodeDom provider type "Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" could not be located.

This is the build server environment:

  • Windows Server 2008 R2 Standard
  • TeamCity 8.0.4
  • .NET 4.5
  • Windows SDK for Windows 7 and .NET 4
  • Windows SDK for Windows 8 and .NET 4.5
  • Portable Class Library Tools
  • ASP MVC 4

It is a ASP MVC 4 web application, targeting .NET 4.5.

The build configuration consists in building the solution with MSBuild, and deploying it to a package, so I can publish it later.

Through the log of TeamCity, I can see the error arising when MSBuild runs aspnet_compiler.exe.

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?

UPDATE

See my answer below.

Answer

Vanitas1440 picture Vanitas1440 · Apr 7, 2017

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.