How to include assemblies from NuGet packages in a VSIX Installer?

后端 未结 4 1290
感动是毒
感动是毒 2021-01-04 02:42

I\'m working on creating a Visual Studio 2017 custom Check-In Policy extension. My current solution is structured as follows:

Note: I am taking advantage of

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 03:23

    I you're looking for a more flexible way to other answers I have used the following.

      
        
        
          
        
      
    

    This will add all resolved project reference NuGet references to the appropriate VSIXSubPath. This will also ignore framework references to NuGet package files.

    The items are added in the target GetVsixSourceItems. I also had issues adding the project output assembly because by default it adds the assembly in the intermediate output path (obj) folder. This was causing issues for me because I sign the assembly in the bin folder. Here's a target to use the bin assembly instead of the intermediate output assembly.

      
        
        
          
    
          
            $(AssemblyVSIXSubPath)
            $(InstallRoot)
            $(Ngen)
            $(NgenApplication)
            $(NgenArchitecture)
            $(NgenPriority)
          
        
      
    

提交回复
热议问题