能否一个.NET的Word 2003外接来的GAC外装? [英] Can a .NET Word 2003 add-in be installed outside of the GAC?

查看:192
本文介绍了能否一个.NET的Word 2003外接来的GAC外装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个Word加载组件,以及Visual Studio安装工程安装的组件。

I've created a Word add-in component, and a visual studio setup project to install the component.

在一个干净的机器安装的Office 2003,它似乎并不可能得到附加的组件Word中加载。

On a clean machine with Office 2003 installed, it does not seem to be possible to get the add-in component to load in Word.

谷歌搜索的问题表明,这是因为该组件是不值得信赖的。我给使用命令行工具组装完全信任:

Googling the issue suggests that this is because the assembly is not trusted. I gave the assembly full trust using the command line tool:

caspol -af AssemblyName.dll

这没有什么区别和compenent仍然没有在Word中加载。 caspol打印出一个消息的因为所有GAC程序集始终得到充分的信任,完全信任列表不 不再有意义。您应该安装在安全使用的任何组件 在GAC政策,以确保他们是值得信赖的

This makes no difference and the compenent is still not loaded in Word. caspol prints out a message "Because all GAC assemblies always get full trust, the full trust list is no longer meaningful. You should install any assemblies that are used in security policy in the GAC to ensure they are trusted"

更改安装程序放置这些组件在GAC允许它在Word中正确加载。但是组件可能必须使用通用组件,在未来,我们的其他.NET应用程序之间共享,并添加这些库到GAC将是不希望的。

Changing the installer to put the assembly in the GAC allows it to correctly load in Word. But the component may have to use common assemblies in the future, shared between our other .NET applications, and adding these libraries to the GAC would be undesirable.

有谁知道如何设置的安全性,允许在海关总署外装组件加载?

Does anyone know how to set the security to allow the component to be loaded when installed outside the GAC?

推荐答案

您可以手动运行下面的命令来设置安全性,让这个词从GAC之外运行的程​​序集。这将创建一个新的组以完全信任这就是允许组件运行。

You can manually run the following command to set security to allow the word to run the assembly from outside the GAC. This creates a new group with full trust which is what allows the assembly to run.

caspol.exe -u -addgroup All_Code -url "\*"  FullTrust -n AssemblyName.dll

微软必须在以下网站链接,MSDN的例子自定义操作的安装程序,这将让你有这个命令安装程序自定义操作。

Microsoft have an example custom action for an installer at the following site link to MSDN, which will allow you to include this command as an installer custom action.

这篇关于能否一个.NET的Word 2003外接来的GAC外装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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