Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The add-in fails to load in VS 2015 #169

Closed
VioletGiraffe opened this issue Sep 19, 2017 · 16 comments
Closed

The add-in fails to load in VS 2015 #169

VioletGiraffe opened this issue Sep 19, 2017 · 16 comments
Labels

Comments

@VioletGiraffe
Copy link
Owner

VioletGiraffe commented Sep 19, 2017

Not sure what's going on. There's nothing on it in the Activity Log, and when I attempt to debug the add-in in VS 2015, the plugin is not even installed in the experimental instance, even though the debugging settings are correct. There are no related messages.

@WhoWouldaThunk
Copy link

WhoWouldaThunk commented Sep 20, 2017

I just reinstalled windows (was on 8.1, now on 10) and VS 2015, downloaded your addon, and had that issue too!
Here's what I have in my activity log for it:

CreateInstance failed for package [CPPCheckPluginPackage]Source: 'mscorlib' Description: Could not load file or assembly 'Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type) at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo) at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

@VioletGiraffe
Copy link
Owner Author

So, the plugin currently depends on Shell 15.0 which is the VS 2017 version. For compatibility with VS 2015, Shell 14.0 reference should be added. But then I'm getting numerous errors of the following kind:

error CS0433: The type 'ToolWindowPane' exists in both 'Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

@icnocop
Copy link
Contributor

icnocop commented Jan 15, 2018

I created pull request #177 to resolve this issue.

The latest appveyor build is here: https://ci.appveyor.com/project/icnocop/cppcheck-vs-addin/build/1.3.5

Notice that there are separate vsix artifacts for Visual Studio 2015 and Visual Studio 2017 because of the different references to "Microsoft.VisualStudio.Shell".

Thank you.

@VioletGiraffe
Copy link
Owner Author

@icnocop
Thanks! So, it's not possible to support both VS versions with the same VSIX file? Or is it just that none of us knows how to do it?

@icnocop
Copy link
Contributor

icnocop commented Jan 15, 2018

VSIX files can support multiple versions of Visual Studio.

I think it would need to be configured in the vsixmanifest file if it's not already configured.

I personally don't have a lot of experience with vsixmanifest files.

The problem here is the dependency on EnvironmentColors and ThemeResourceKey which are defined in Microsoft.VisualStudio.PlatformUI and Microsoft.VisualStudio.Shell respectively, and those are different depending on the version of Visual Studio SDK that's installed.

I'm thinking we can try to either decouple that dependency, or maybe include those assemblies within the VSIX (if the license permits for example), then we may not need to build two versions of the VSIX.

@icnocop
Copy link
Contributor

icnocop commented Jan 15, 2018

Here's a good reference:
https://msdn.microsoft.com/en-us/magazine/mt493251.aspx

It seems that instead of referencing Microsoft.VisualStudio.Shell.14.0 and Microsoft.VisualStudio.Shell.15.0, we need to reference Microsoft.VisualStudio.Shell.11.0, but I haven't tested this yet.

https://stackoverflow.com/a/37880406/90287 indicates we can use the NuGet Package VSSDK.Shell.11.

I'll have to test it out. :)

@icnocop
Copy link
Contributor

icnocop commented Apr 12, 2018

I tested CppcheckPlugin.vsix from https://ci.appveyor.com/project/VioletGiraffe/cppcheck-vs-addin/build/1.3.8/artifacts in Visual Studio 2015 Update 3 on Windows 10 64-bit and it works without issues. :)

@ruizpauker
Copy link

Hi, I'm facing this error with VS2015, is there any way to overcome it?

@VioletGiraffe
Copy link
Owner Author

Try the VSIX linked above.

@ruizpauker
Copy link

Yes, thanks I tried that one and it worked!

Anyway thou I'm wondering why it's not included as a Project Relase, the latest relase there is 1.3.4 while the one on the link provided is 1.3.8, shouldn't this be harmonized/synced?

@VioletGiraffe
Copy link
Owner Author

I remember how I thought it's time to update the release, but don't recall why I didn't go through with that after all. Perhaps, another important bug was discovered. But you're right, I should probably release the latest version and see what happens.

@ruizpauker
Copy link

If support is needed I'll be glad to help.

@gordon-proctor
Copy link

The artifact at https://ci.appveyor.com/project/VioletGiraffe/cppcheck-vs-addin/build/1.3.8/artifacts has been deleted as it was more than 6 months old. Can you generate a new one or include it in the Project Release?

@VioletGiraffe
Copy link
Owner Author

@gordon-proctor : try this one.
CppcheckPlugin.zip

@gordon-proctor
Copy link

That worked, thank you.

@VioletGiraffe
Copy link
Owner Author

Should be fixed in the latest release now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants