Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load type 'Microsoft.Cct.Services.Sqm.IWatSqmService'

When publishing my cloud service from Visual Studio 2015 I get this error:

10:11:26 AM - Instance 0 of role MySite is ready
10:11:26 AM - Instance 1 of role MySite is ready
10:11:27 AM - Starting...
10:11:45 AM - Initializing...
10:11:46 AM - Created web app URL: http://mysite.cloudapp.net/
10:11:46 AM - Complete.
10:11:46 AM - Could not load type 'Microsoft.Cct.Services.Sqm.IWatSqmService' from assembly 'Microsoft.VisualStudio.WindowsAzure.Services, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

This happens at the end of deployment and the site seems to be deployed but Visual Studio still says the deployment failed. How do I fix that?

like image 288
UserControl Avatar asked Nov 29 '16 08:11

UserControl


1 Answers

I solved this issue today and see you guys have as well. Took me a solid day of re-installing SDK and running repairs with no resolution. Issue occurs on projects created before Azure SDK 2.9.x and after the latest 2.9.6 SDK is installed. For whatever reason - Visual Studio doesn't seem to recognize older versions of the project properly - namely where to go for the assemblies - hence 'Could not load type'. Usually, it prompts you to upgrade the solution - but this fails so here is the manual way to see if an upgrade is available or to perform the upgrade yourself.

Check For Upgrade

  • Right click Azure Cloud project (assuming you have installed Azure SDK NET to 2.9.6) and click Properties.

  • Navigate to the Application tab (if not there) and see a message that states (for older versions) Click here to Upgrade the project to the latest SDK format.

Manual Alternative
Convert a line (about line 9) in your "AZURE.CCPROJ" file in your Azure Solution folder: <ProductVersion>2.8</ProductVersion> needs to be
<ProductVersion>2.9</ProductVersion>

Convert another line (about line 66) in the same file from:
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.8\</CloudExtensionsDir>

To:
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.9\</CloudExtensionsDir>

Clean solution afterwards, close solution, then restart Visual Studio and open your project.

Note: You may get a failed to debug error afterwards, claiming it can't find a specific folder. Don't fret and try changing your Configuration from "Debug" to one of the other configuration options - I think some older projects used configuration "Development" for debug. That's a case by case basis.

Note 2: To those who can't upgrade, you should try and reinstall SDK 2.8.2 and verify the \2.8\ folder is in existence. Also need to uninstall 2.9.6 first - pre-requisites such as the Azure emulator can't co-exist with other versions.

like image 80
HouseCat Avatar answered Sep 29 '22 12:09

HouseCat