Search code examples
c#asp.netazureazure-cloud-services

Azure web role build error: "Unable to import module Diagnostics. No manifest was found"


We have a C# web application solution configured to run on Azure cloud services. It's an old solution and builds fine locally on other engineers' laptops (has done for years), and on my previous laptop. But I have a new laptop where I've set up my development environment but this particular solution does not build.

There are two related build errors:

  • Unable to import module Diagnostics. No manifest was found. in _ServiceDefinition.csdef _(part of the ccproj project)
  • CloudServices58 : Cannot load imported module named 'Diagnostics.' at C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VisualStudio\v17.0\Windows Azure Tools\2.9\Microsoft.WindowsAzure.targets

VS error: "Unable to import module Diagnostics. No manifest was found

The ServiceDefinition.csdef file includes this section:

<Imports>
    <Import moduleName="Diagnostics" />
    <Import moduleName="RemoteAccess" />
    <Import moduleName="RemoteForwarder" />
</Imports>

If I remove that first Import line then the build succeeds.

I've searched everywhere for a solution. There are a couple of similar questions here on SO but the answers usually come down to installation of Azure SDK, but I can confirm I have this installed at this location:

C:\Program Files\Microsoft SDKs\Azure.NET SDK\v2.9

I've run out of options. Can any of you help?


Solution

  • The issue seems to be that the Azure SDK 2.9 that gets installed by Visual Studio setup is missing the Diagnostics plugin. On a working (old) machine, go to C:\Program Files\Microsoft SDKs\Azure\ .NET SDK\v2.9\bin\plugins and copy the Diagnostics folder into the same location on the new computer.