安装VSTO 4.0导致VSTO 3.0外接程序退出工作 [英] Installing VSTO 4.0 Causes VSTO 3.0 Addin to quit working
问题描述
我昨天刚刚安装了Visual Studio 2010.为此,我安装了VSTO 4.0.现在,当我运行任何Office应用程序时,我的VSTO 3.0加载项都无法加载.事件日志中的错误是
I just installed Visual Studio 2010 yesterday. As part of that I installed VSTO 4.0. Now when I run any Office application, my VSTO 3.0 addins fail to load. The error in the event log is
自定义URI:file:///H:/PathToMyAddin/MyAddin.vsto 例外:自定义没有创建应用程序域所需的权限.
Customization URI: file:///H:/PathToMyAddin/MyAddin.vsto Exception: Customization does not have the permissions required to create an application domain.
Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: 定制没有 创建一个所需的权限 应用程序域. ---> System.Security.SecurityException: 定制功能 该应用程序将无法正常工作,因为 管理员已列出 文件:///H:/PathToMyAddin/MyAddin.vsto 不信任.与您的联系 管理员以获得进一步的帮助. 在 Microsoft.VisualStudio.Tools.Office.Runtime.RuntimeUtilities.VerifySolutionUri(Uri uri)在 Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation,字符串manifestName, 字符串documentName,布尔值 showUIDuringDeployment,IntPtr hostServiceProvider,IntPtr&遗嘱执行人) 装配失败的区域 原是:MyComputer
Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization does not have the permissions required to create an application domain. ---> System.Security.SecurityException: Customized functionality in this application will not work because the administrator has listed file:///H:/PathToMyAddin/MyAddin.vsto as untrusted. Contact your administrator for further assistance. at Microsoft.VisualStudio.Tools.Office.Runtime.RuntimeUtilities.VerifySolutionUri(Uri uri) at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor) The Zone of the assembly that failed was: MyComputer
似乎这可能是由于它尝试加载具有相同进程/AppDomain的不同版本的.NET所致.但是,该错误将表明这是某种权限问题.
It seems like like maybe this is due to it trying to load different version of .NET is the same process/AppDomain. However the error would indicate it's some sort of permissions issue.
推荐答案
事实证明,默认情况下,VSTO 4不信任网络位置上的加载项.但是,通过添加以下注册表项
It turns out that VSTO 4 doesn't trust add-ins on network locations by default. However, by adding the following registry key
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\vsto runtime Setup\v4]
"EnableVSTOLocalUNC"=dword:00000001
并重新启用我的加载项,它似乎又可以正常工作了.
and re-enabling my add-in, it appeared to work as expected again.
某些用户的另一种选择是将加载项安装在用户的本地计算机上,而不是在网络位置上
Another option for some is just to install the add-in on the user's local machine instead of on a network location
这篇关于安装VSTO 4.0导致VSTO 3.0外接程序退出工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!