skip to Main Content

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 FilesMicrosoft Visual Studio2022EnterpriseMSBuildMicrosoftVisualStudiov17.0Windows Azure Tools2.9Microsoft.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 FilesMicrosoft SDKsAzure.NET SDKv2.9

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

3

Answers


  1. Please check the steps if helps to work around:

    • Check the Import Module Diagnostics Code is under the WebRole in ServiceDefinition.csdef file.

    • Configure Web.config file to add Diagnostics Module for Listeners type like:

    <system.diagnostics>
    <trace>
    <listeners>
    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,
    Microsoft.WindowsAzure.Diagnostics,
    Version=1.0.0.0,
    Culture=neutral,
    PublicKeyToken=31bf3856ad364e35"
    name="AzureDiagnostics">
    <filter type=""/>
    </add>
    </listeners>
    </trace>
    </system.diagnostics>
    
    • Configuring the Azure Storage Account in the ServiceConfiguration.cscfg
    <ConfigurationSettings>
    <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=[youracountnamehere];AccountKey=[youraccountkeyhere]/>
    </ConfigurationSettings>
    <Certificates>
    </Certificates>
    </Role>
    </ServiceConfiguration>
    
    • Similar kind of issue is resolved here by re-installing the Windows Azure Tools of VS.

    • This issue has been addressing since Azure SDK 2.4 even there is no code dependent but need those modules to collect the data for debugging purposes. Try to uninstall and install again, the Azure Development Tools and its included SDK Components in VS:
      Visual Studio > Tools > Get Tools & Features:

    enter image description here

    References:

    Login or Signup to reply.
  2. I had a similar issue with "Caching" import. This worked for me:

    Click to see image

    The "Caching" folder was missing from the Plugins folder, so I copied it from a machine that was working. i.e. check for a missing "Diagnostics" folder.

    Login or Signup to reply.
  3. 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 FilesMicrosoft SDKsAzure .NET SDKv2.9binplugins and copy the Diagnostics folder into the same location on the new computer.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search