I am trying to make one VSIX plugin in C#. The plugin works fine in when I am in develop mode. But when I am trying to install the plugin i.e. by double clicking the VSIX, it is not working. I have read some documents and some people ae saying to make it package and then do the installation. But when I am setting the "Generate .pkgdef file" option as "True", I am getting a errors like - "CreatePkgDef : error : ArgumentException: No Visual Studio registration attribute found in this assembly." and The assembly should contain an instance of the attribute 'Microsoft.VisualStudio.Shell.RegistrationAttribute' defined in assembly 'Microsoft.VisualStudio.Shell.Framework' version '16.0.0.0'
Basically I want to deploy my VSIX. How can I do this ?Can someone help in this ? Thank you.
I got the real issue. Actually I am using ITeamExplorerNavigationItem2 to add a button in the Team Explorer. I am using the property public System.Drawing.Image Image to control the button Icon.
public System.Drawing.Image Image => null // Button comes up without any button icon
public System.Drawing.Image Image => System.Drawing.Image.FromFile("MyImage.png"); // button does not show up in the team explorer
What I am suspecting is, during debug it is finding the path of the "MyImage.png" but at run time the Image is not packaged to the VSIX, so it is not finding the .png path and subsequently it is not displaying the icon and button.
To fix this issue, I actually added a Resource.resx file to the project and added the Image inside that. Since the resource.resx file is added to VSIX file during compile time it is displayed correctly after installation. The modified code
public System.Drawing.Image Image => Resource.MyImage;