Could not load type 'Microsoft.Cct.Services.Sq

2020-04-03 05:53发布

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?

4条回答
Lonely孤独者°
2楼-- · 2020-04-03 06:00

Based on your description, it seems that something went wrong when you update Azure SDK to 2.9.6. For this type issue, I would suggest you to reinstall Azure SDK. It should fix this issue. We could download the SDK at this link. Please try it. If you still have some issues, please come back with more detailed info.

查看更多
混吃等死
3楼-- · 2020-04-03 06:12

What has worked for me is just uninstalling everything SDK 2.7 related and upgrading my Azure project to 2.9 as mentioned by @Mikkel Mørk Hegnhøj

查看更多
贪生不怕死
4楼-- · 2020-04-03 06:13

I got this when working in Visual Studio 2013 on a 2.8 project. I had 2.8 and 2.9 installed.

My issues was that I was using the CloudConfigurationManager.GetSetting("your.setting.here") when I hadn't added it to the .cscfg or .csdef files properly.

Check that all your settings are defined, and that you have referenced the correct Microsoft.WindowsAzure.Storage DLL too, as this can be used with the CloudConfigurationManager settings.

查看更多
Ridiculous、
5楼-- · 2020-04-03 06:24

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.

查看更多
登录 后发表回答