0
votes

My build pipeline (Microsoft-hosted agent) has been running every morning for a couple of months but this morning it suddenly failed on the VSBuild task. The error is described as:

"##[error]ASPNETCOMPILER(0,0): Error ASPCONFIG: The CodeDom provider type "Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" could not be located."

See image of failed build here

How do i fix this?

2

2 Answers

0
votes

Not sure if you use private agent. As I know this error could result from the fact that PrecompileBeforePublish property is set to true somewhere in your project.(csproj or publish profile).

As one workaround you can pass /p:PrecompileBeforePublish=false as argument to your VSBuild Task. But this may make first response of your application slow.

Or you can register it into GAC using command like this:

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\xxxx\VSEditon\Common7\IDE\PublicAssemblies\CppCodeProvider.dll"

Cause after VS2017, the C++ project support for xsd.exe is deprecated, we need to manually add its assembly into GAC as described here.

-1
votes

I managed to solve this by just skipping build on the assets project that failed. This was done using the Configuration Manager in Visual Studio (found in Build->Configuration Manager). I just removed the check mark. See attached images for clarification.

Skip project build

Configuration Manager