1

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?

Pod Mo
  • 248
  • 2
  • 8
Halling
  • 37
  • 6
  • My devops build ran fine 11/15/2021. Tried to run the same build from the same git commit today (1/6/2022) and it's failing with this error. – pettys Jan 07 '22 at 04:46

2 Answers2

-1

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.

LoLance
  • 25,666
  • 1
  • 39
  • 73
-2

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

Halling
  • 37
  • 6
  • Excluding projects is not really a solution. When trying to build a project that needs the CodeDom configs to build (interpolated strings, for example), excluding that project would not be helpful at all. – Lemiarty Jan 04 '22 at 15:36