无法加载类型“Microsoft.Cct.Services.Sqm.IWatSqmService” [英] Could not load type 'Microsoft.Cct.Services.Sqm.IWatSqmService'
问题描述
从Visual Studio 2015发布云服务时,我收到以下错误:
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'.
这在部署结束时发生,该网站似乎已部署,但Visual Studio仍然表示部署失败。我如何解决这个问题?
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?
推荐答案
我今天解决了这个问题,看到你们也有。给我一个坚实的一天重新安装SDK和运行维修没有解决。在Azure SDK 2.9.x之前创建的项目和最新的2.9.6 SDK安装后,会出现问题。无论什么原因 - Visual Studio似乎不能正确识别项目的旧版本 - 即哪里去组装 - 因此无法加载类型。通常,它会提示您升级解决方案 - 但是失败,因此这里是手动查看升级是否可用或自行执行升级。
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.
检查升级
-
右键单击Azure Cloud项目(假设您已安装Azure SDK NET到
2.9.6),然后点击属性。
Right click Azure Cloud project (assuming you have installed Azure SDK NET to 2.9.6) and click Properties.
导航到应用程序选项卡(如果没有),并看到一条消息,指出(对于
旧版本)点击此处升级项目到最新的SDK
格式。
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.
手动替代
转换一行(关于第9行)您的Azure解决方案文件夹中的AZURE.CCPROJ文件:< ProductVersion> 2.8< / ProductVersion>
需要是
< ProductVersion> 2.9< / ProductVersion>
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>
转换另一行(关于第66行)在同一个文件中:
< CloudExtensionsDir Condition ='$(CloudExtensionsDir)'==''> $(MSBuildExtensionsPath)\Microsoft\VisualStudio\\ \\ v $(VisualStudioVersion)\Windows Azure Tools\2.8\< / CloudExtensionsDir>
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>
至:
< CloudExtensionsDir Condition ='$(CloudExtensionsDir)'==''> $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v $(VisualStudioVersion)\Windows Azure Tools\2.9\< / CloudExtensionsDir>
To:
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.9\</CloudExtensionsDir>
然后清理解决方案,然后重新启动Visual Studio和打开您的项目。
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.
注意2:对于无法升级的人,您应该尝试并重新安装SDK 2.8.2并验证\2.8\文件夹是否存在。还需要卸载2.9.6,首先,诸如Azure模拟器之类的先决条件不能与其他版本共存。
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.
这篇关于无法加载类型“Microsoft.Cct.Services.Sqm.IWatSqmService”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!