Unable to load the imported module named Diagnostics.

VS 2013 build fails with the following error:

C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v12.0 \ Windows Azure Tools \ 2.5 \ Microsoft.WindowsAzure.targets (684.5): error: CloudServices58: Unable to load the imported module named "Diagnostics" .

ServiceDefinition.csdef file:

 <ServiceDefinition name="MYWEBPROJECTNAME.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-06.2.4"> <WebRole name="MYWEBPROJECTNAME" vmsize="Small"> <Imports> <Import moduleName="Diagnostics" /> </Imports> </WebRole> </ServiceDefinition> 

I tried reinstalling the Azure SDK 2.5 from here http://azure.microsoft.com/en-us/downloads/ for VS 2013, and this did not help.

UPDATE

It breaks into

  <ValidateServiceFiles ServiceDefinitionFile="@(SourceServiceDefinition)" ServiceConfigurationFile="@(SourceServiceConfiguration)"> </ValidateServiceFiles> 

The ValidateServiceFiles task calls Microsoft.ServiceHosting.Tools.MSBuildTasks.ImportResolver and cannot find the Diagnostics module. A task gets its modules from an array of ImportedModules elements.

UPDATE 2

There seems to be some problem with installing VS 2012/2013. When running "VS2012 x86 Native Tools Command Prompt" ( %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"" x86 ), msbuild displayed this error. The same thing when starting the "Microsoft Azure Command Prompt - v2.5" ( C:\Windows\System32\cmd.exe /E:ON /V:ON /K "C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\\bin\setenv.cmd" ).

C: \ SOMEPATH \ MYWEBPROJECTNAME.Azure.ccproj (72.3): error MSB4019: Imported project "C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v11.0 \ Windows Azure Tools \ 2.5 \ Microsoft.WindowsAzure .targets "not found. Verify that the path in the declaration is correct and that the file exists on disk.

Removing VS 2012 and repairing VS 2013 did not help.

+6
source share
2 answers

I had to remove an element from my csdef file in order to get my project to compile. Then I followed this http://msdn.microsoft.com/en-us/library/azure/dn186185.aspx#BK_Migration

+5
source

The dialog approach to Azure SDK 2.4 and Azure SDK 2.5 uses a diagnostic method. You can read about the changes at https://msdn.microsoft.com/en-us/library/azure/dn186185.aspx#BK_Migration . However, I did not have the code that affected the change, but there ServiceDefinition.csdef had an import for diagnostics.

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

The error was supported in Microsoft.WindowsAzure.targets. Since I did not have any code dependent on these modules, I just commented on the two links and everything that was beautifully built.

+1
source

Source: https://habr.com/ru/post/980263/


All Articles