如何从 VSTO Word Doc 项目引用未签名的程序集?
我在VS2008中创建了一个新项目。 项目类型
Visual C# > Office > 2007 > Word 2007 Document
添加了一些代码..让 Word 完成了一些自定义循环的跳转..一切都很好。 现在我需要引用另一个未签名的程序集(CopyLocal as false
)。 所以我添加了项目参考。 现在项目不会建抱怨
错误 MSB3188:程序集“X.dll”必须 签名要强才能被标记 作为先决条件。
错误代码页简洁(现在已习惯对此) 从那时起就一直在谷歌上搜索和阅读帖子……不走运。
我该如何解决这个问题? 或者是隐藏的戒律,即所有引用(对于 VSTO?)都必须具有强命名/签名。
我无法签署 X.dll 并完成它,因为它是一个我无法控制的二进制文件,而且它依赖于另一堆未签名的 dll.. 无法引发连锁反应。
更新:通过设置CopyLocal=True解决了构建问题。 但这意味着将引用的 X.DLL 及其所有依赖项转储到 bin\debug 文件夹中...呃! 尝试创建一个名为 bin\debug\refExecs
的子文件夹,并从那里引用 X.dll CopyLocal=false
。 错误信息又回来了。
I created a new project in VS2008. Project type
Visual C# > Office > 2007 > Word 2007 Document
Added some code.. got Word to do a few jumps through some custom hoops.. all fine. Now I need to reference another assembly (CopyLocal as false
) which is not signed. So I add the project reference. Now the project will not build complaining
error MSB3188: Assembly 'X.dll' must
be strong signed in order to be marked
as a prerequisite.
The error code page is concise (now accustomed to this)
Been googling and reading posts ever since.. No Luck.
How do I get around this ? Or is the hidden commandment that all references (for VSTO?) must be strong named / signed.
I cannot sign X.dll
and be done with it because it is a binary that I don't control also it depends on another bunch of unsigned dlls.. can't set off a chain sign reaction.
Update: Solved the build issue by turning CopyLocal=True. But this meant dumping the referenced X.DLL and all its dependencies into the bin\debug folder... Ughh! Tried creating a subfolder called bin\debug\refExecs
and referencing X.dll CopyLocal=false
from there. The error message was back.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决这个问题的另一种方法是在运行时动态加载程序集。
谷歌搜索解决方案提出了以下内容
Another way to get around this should be to load the assembly dynamically during runtime.
Googling for a solution brought up the following posting, maybe this is of any help?