简体   繁体   English

将WPF自定义控件库引用到VSIX项目

[英]Reference WPF custom control library to a VSIX project

I have a WPF Custom control project and a VSIX project in my solution. 我的解决方案中有一个WPF自定义控件项目和一个VSIX项目。 THe WPF holds the UI windows and controls that are required both by the VSIX and another WPF app that can be used separately from the VS extension. WPF拥有VSIX和另一个可以与VS扩展分开使用的WPF应用程序所需的UI窗口和控件。

I have added the project as a dependency in source.extension.vsixmanifest like so: 我将项目作为依赖项添加到source.extension.vsixmanifest如下所示:

<Asset Type="Microsoft.VisualStudio.Assembly" d:Source="Project" d:ProjectName="StringsRefactor.UI" Path="|StringsRefactor.UI|" AssemblyName="|StringsRefactor.UI;AssemblyName|" />

the code compiles but during runtime when i consturct the required object from thr StringsRefactor.UI assembly i get the following error: 代码可以编译,但是在运行时当我从StringsRefactor.UI程序集StringsRefactor.UI所需的对象时,出现以下错误:

Could not load file or assembly 'StringsRefactor.UI, Version=1.0.0.0, Culture=neutral, PublikKeyToken=null' or one of its dependencies. 无法加载文件或程序集'StringsRefactor.UI,版本= 1.0.0.0,文化=中性,PublikKeyToken =空'或其依赖项之一。 A strongly-named assembly is required. 需要一个全名程序集。 (Exception from HRESULT: 0x80131044) (来自HRESULT的异常:0x80131044)

How should i create a strongly-named assembly ? 我应该如何创建一个strongly-named assembly Or should i do something else ? 还是我应该做别的事情?

只需签署您的WPF程序集,Visual Studio就会要求它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM