简体   繁体   English

VSIX软件包安装和注册自定义库

[英]VSIX package installation with registering custom library

I made a Visual Studio extension using Roslyn to analyze and refactor source code. 我使用Roslyn进行了Visual Studio扩展,以分析和重构源代码。 I work on a custom attribute that is declared in another project in the solution, and in my analyzer, I search for that attribute. 我处理在解决方案中的另一个项目中声明的自定义属性,然后在分析器中搜索该属性。 My project structure is like below: 我的项目结构如下:

  • CustomAnalyzer.Base (Class library) CustomAnalyzer.Base(类库)
    • CustomAnalyzer.Base.MyCustomAttribute.cs (My attribute class) CustomAnalyzer.Base.MyCustomAttribute.cs(我的属性类)
  • CustomAnalyzer (Analyzing and Refactoring methods) CustomAnalyzer(分析和重构方法)
  • CustomAnalyzer.Vsix (VSIX package project) CustomAnalyzer.Vsix(VSIX包项目)

CustomAnalyzer project has a reference to CustomAnalyzer.Base . CustomAnalyzer项目具有对CustomAnalyzer.Base的引用。 I want that programmers be able to add CustomAnalyzer.Base.MyCustomAttribute annotation in top of their methods after installing extension on their Visual Studio . 我希望程序员在Visual Studio上安装扩展后,可以在其方法的顶部添加CustomAnalyzer.Base.MyCustomAttribute批注。 But when I install the extension, I cannot add a reference to CustomAnalyzer.Base since this library is not in assemblies list. 但是,在安装扩展程序时,由于该库不在程序集列表中,因此无法添加对CustomAnalyzer.Base的引用。

How can I register my Class Library as an Extension or Framework Assembly when the extension has been installed? 安装扩展后,如何将我的类库注册为扩展或框架程序集?

please sign your class library project with package project key.snk. 请使用包项目key.snk对您的类库项目进行签名。

right click project -> Properties -> signing -> enable sign the assembly -> click the dropdownlist below -> Browser... -> select key.snk file in the project named HelloWorld2Parter -> Open -> rebuild your project. 右键单击项目->属性->签名->启用对程序集签名->单击下面的下拉列表->浏览器...->在名为HelloWorld2Parter的项目中选择key.snk文件->打开->重建项目。

在此处输入图片说明

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

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