Azure云服务:“不允许请求的注册表访问". VS2015 [英] Azure Cloud Service: "Requested registry access is not allowed". VS2015

查看:135
本文介绍了Azure云服务:“不允许请求的注册表访问". VS2015的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试将运行在Azure 2.6和Azure Cloud Services上的后端解决方案迁移到Windows 10工作站上VS2015中的VS2015中的Azure 2.7.

I've been trying for days to migrate our backend solution running on Azure 2.6 and Azure Cloud Services to Azure 2.7 in VS2015 on Windows 10 workstation, but without any luck.

我尝试在多台计算机上使用全新安装的Windows 10 Pro x64和Visual Studio 2015 Enterprise(已安装所有功能). Windows Update和Vs2015中所有可用的更新均已安装. 我创建了一个具有空Web角色的新Cloud Service解决方案. 我已将VS2015设置为打破公共语言运行时异常" (调试-> Windows->例外设置). 我在运行Win 8.1,VS2015,Azure 2.7的单独计算机上遇到了相同的错误.

I've tried on multiple computers using a clean install of Windows 10 Pro x64 with Visual Studio 2015 Enterprise (all features installed). All updates available in both Windows Update and Vs2015 are installed. I create a new Cloud Service solution, with one Empty web role. I've set VS2015 to break on "Common Language Runtime Exceptions" (Debug -> Windows -> Exception Settings). I've run into the same errors on a separate machine running Win 8.1, VS2015, Azure 2.7.

该解决方案可以很好地编译,但是当我尝试运行/调试Cloud Service项目时,它将引发以下错误:

The solution compiles fine but when I try to run/debug the Cloud Service project it throws the following error:

抛出异常:mscorlib.dll中的'System.Security.SecurityException'

Exception thrown: 'System.Security.SecurityException' in mscorlib.dll

其他信息:不允许请求的注册表访问.

Additional information: Requested registry access is not allowed.

仅在不使用CloudService的情况下启动WebRole即可.

Starting only the WebRole without using the CloudService works.

当我尝试通过具有管理员权限的VS2015运行CloudService时,会引发以下异常:

When I try to run the CloudService through VS2015 with administrator priviliges the following exception is thrown:

mscorlib.dll中的'System.Threading.WaitHandleCannotBeOpenedException'

'System.Threading.WaitHandleCannotBeOpenedException' in mscorlib.dll

其他信息:不存在给定名称的句柄.

Additional information: No handle of the given name exists.

在检查智能日志时将已编译的解决方案发布到Azure会产生相同的异常(不允许请求的注册表访问").

Publishing the compiled solution to Azure yeilds the same exception when inspecting the intellisense logs ("Requested registry access is not allowed").

我尝试从此博客文章中添加install.cmd脚本,以在部署时在Azure Cloud Service上安装4.5.2或4.6,但结果没有任何变化:

I've tried to add the install.cmd script from this blog post to install 4.5.2 or 4.6 on Azure Cloud Service when deploying but without any change in result: https://azure.microsoft.com/en-us/documentation/articles/cloud-services-dotnet-install-dotnet/

  • 云服务是否与Azure 2.7兼容? -更新:是的.确保使用.Net Framework v4.5.1

  • Are Cloud Services compatible with Azure 2.7? -- UPDATE: Yes. Make sure you use .Net framework v4.5.1

在本地调试模式下运行时,真的需要install.cmd脚本吗?应该已经安装了4.5.2和4.6,对吧?

Is the install.cmd script really needed when running in local debug mode? Both 4.5.2 and 4.6 should already be installed, right?

还有其他人遇到这个问题吗?

Anyone else experiencing problems with this?

任何有关如何使Cloud Services与Windows10,Vs2015和Azure 2.7一起使用的帮助或提示都非常有用!

Any help or hints on how to get Cloud Services to work with Windows10, Vs2015 and Azure 2.7 are greatly appriciated!

这是一个带有示例项目的仓库: https://www.dropbox.com/s/ie7jcn932nsddio/CloudServiceRepo.zip?dl=0

Here is a repo with a sample project: https://www.dropbox.com/s/ie7jcn932nsddio/CloudServiceRepo.zip?dl=0

推荐答案

如果,您的根本原因与我的相同,那么我有一种解决方法(如果不是实际原因和解决方案)

If your underlying cause is the same as mine, I have a workaround (if not an actual cause and solution)

在您的辅助角色的app.config的运行时-> assemblyBinding部分下添加此代码:

Add this under the runtime -> assemblyBinding section of the app.config for your worker role:

  <dependentAssembly>
    <assemblyIdentity name="Microsoft.WindowsAzure.Diagnostics" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.7.0.0" newVersion="2.7.0.0" />
  </dependentAssembly>

这就是我到达这里的方式.在带有SDK 2.7的VS2015中,我创建了一个全新的空云服务.我加入了现有的工作人员角色,该角色是使用SDK 2.6创建的,并已升级到2.7.这次,我收到一个新错误,抱怨它找不到Microsoft.WindowsAzure.Diagnostics 2.6版.在我的工作者角色中,我的程序集引用适用于2.7版,而不是2.6版.因此,处于工作者角色的角色(我无法找到或理解)仍然需要此程序集的2.6版. SDK升级错误?不知道.无论如何,通过在app.config中添加此条目,我强制它改为使用2.7版.

Here's how I arrived at this. In VS2015 with SDK 2.7, I created a brand-new, empty cloud service. I pulled in my existing worker role, which was created with SDK 2.6 and upgraded to 2.7. This time, I got a new error complaining that it could not find Microsoft.WindowsAzure.Diagnostics version 2.6. In my worker role, my assembly reference is for version 2.7, not 2.6. So, something in the worker role (which I cannot find or understand) still wants version 2.6 of this assembly. Bad upgrade by the SDK? Dunno. Anyway, by adding this entry in the app.config, I force it to use version 2.7 instead.

我不知道为什么在创建新的云服务与使用旧的云服务时会收到不同(更准确)的错误消息.我也不知道这与原始的"WaitHandle"错误有什么关系,但是也许那是一条红鲱鱼,而原始的问题始终是版本不匹配?我想知道是什么引起了这个问题,什么是正确的长期解决方案,但是我现在就解决这个问题.

I don't know why I get a different (and more accurate) error message when I create a new cloud service, versus using the old one. I also don't know what this has to do with the original "WaitHandle" error, but perhaps that was a red-herring, and the original problem has always been a version mismatch? I'd like to know what caused this problem and what the proper long-term solution is, but I'll settle for this workaround for now.

祝您好运,我希望这对您有用,对我也一样.

Good luck, I hope this works for you as it did for me.

这篇关于Azure云服务:“不允许请求的注册表访问". VS2015的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆