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

Could not load "Microsoft.VisualStudio.Shell.10.0, Version=12.0.0.0" (VS2012) #2

Closed
dsherret opened this issue Jan 17, 2014 · 11 comments

Comments

@dsherret
Copy link

This occurs when I click the menu item to nest two files together. The program display an error message saying it failed to load, then says to look in ActivityLog.xml

I tried to open up the solution to figure out what was wrong with the references, but I can't load the project file because it's for VS2013 and I have VS2012. Basically, it wasn't worth my hassle so I will just edit the project file manually... but I thought I would leave you with my error log anyways:

  <entry>
    <record>540</record>
    <time>2014/01/17 01:15:58.470</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>End package load [NestIn.NestInPackage, NestIn, Version=1.1.1.0, Culture=neutral, PublicKeyToken=735d15f764f78d03]</description>
    <guid>{34CBC46C-355B-4FB7-98CB-75D76A6983D7}</guid>
    <hr>80004005 - E_FAIL</hr>
    <errorinfo>Could not load file or assembly 'Microsoft.VisualStudio.Shell.10.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</errorinfo>
  </entry>
@tomdebie
Copy link

I've had the same issue and been able to create a workaround based on a connect report at "https://connect.microsoft.com/VisualStudio/feedback/details/794961/previous-version-assemblies-cannot-load-in-visual-studio-2013".

You can add the following binding redirect to your devenv.exe.config (By default located under "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE") to get Nestin running again.
A restart of visual studio is required.

<dependentAssembly>
    <assemblyIdentity name="Microsoft.VisualStudio.Shell.10.0" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="12.0.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>

On a sidenote:
Since the "Microsoft.VisualStudio.Shell.10.0, Version=12.0.0.0" is introduced as part of VS2013, I believe this bug has been introduced with the changes to Nestin regarding compatibility with VS2013.

@aaronmorgan
Copy link

@tomdebie Thank you, this fixed the problem on one of my VS 2012 PCs. The devenv.exe.config already contained the assemblyIdentity section but the oldVersion was 2.0.0.0-10.0.0.0. Changing it to 12.0.0.0 fixed NestIn.

However, on another PC the .config file change broke three other VS extensions, including AnkhSVN and Rename Visual Studio Window Title. I reverted to the original assemblyIdentity and added a new dependentAssembly section (as above). This seems to have fixed NestIn without breaking the other extensions. (I can't be sure this is the correct approach or won't create other issues.)

@jeremysimmons
Copy link
Collaborator

Recompiling NestIn.dll with an explicit reference to a lower version of Microsoft.VisualStudio.Shell.10.0 also works great.

Would you consider this in a pull request?

index a658ac2..655d640 100644
--- a/NestIn/NestIn.csproj
+++ b/NestIn/NestIn.csproj
@@ -59,10 +59,7 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="Microsoft.CSharp" />
-    <Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.ComponentModelHost.dll</HintPath>
-    </Reference>
+    <Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"/>
     <Reference Include="Microsoft.VisualStudio.OLE.Interop" />
     <Reference Include="Microsoft.VisualStudio.Shell.Interop" />
     <Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
@@ -72,9 +69,7 @@
     <Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0" />
     <Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0" />
     <Reference Include="Microsoft.VisualStudio.TextManager.Interop" />
-    <Reference Include="Microsoft.VisualStudio.Shell.10.0">
-      <Private>false</Private>
-    </Reference>
+    <Reference Include="Microsoft.VisualStudio.Shell.10.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"/>
     <Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0" />
     <Reference Include="System" />
     <Reference Include="System.ComponentModel.Composition" />

@jfromaniello
Copy link
Owner

@jeremysimmons Sorry, I wasn't receiving notifications for this repository :(

yes sure, go ahead and send me a pull request

Do you think it will work for newer versions for vs?

@jeremysimmons
Copy link
Collaborator

@jfromaniello I will submit the pull request. If the newer version of visual studio (2013) has that specific assembly, yes, it would work. Because that's a reference to an assembly with the strong name, both the name and version have to match. I don't know. I will put a copy of VS2013 on a clean OS to check if it does.

@jeremysimmons
Copy link
Collaborator

@jfromaniello I checked for Microsoft.VisualStudio.Shell.10.0, Version=11.0.0.0 after a clean install of VS2013, it only had 12.0.0.0 in C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Shell.10.0.
I don't think my pull request would have the benefit that's desired here of making all versions of VS compatible with this plugin. I think you're stuck distributing multiple versions.
The Nuget Package Manager has a version for 2010/2012 and different for 2013
https://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c 2010,2012
https://visualstudiogallery.msdn.microsoft.com/4ec1526c-4a8c-4a84-b702-b21a8f5293ca 2013

Might be worth looking into how they accomplish this.

https://github.com/Haacked/NuGet/
See the msbuild properties ShellAssembly and ShellAssemblyHintPath for how they pull this off.

I will see if I can scrounge together some time this weekend.

@jeremysimmons
Copy link
Collaborator

@jfromaniello I looked into how Nuget is doing this. I didn't have time to implement but made some promising headway into understanding how it works. I'll keep you posted this week.

@jfromaniello
Copy link
Owner

@jeremysimmons awesome, thank you very much for taking care of this. I am in a completely different position right now, and I haven't been involved with .Net and VS since the last 3 years

I gave you access to the repository,

@mayerwin
Copy link

mayerwin commented May 1, 2015

Check this very insightful answer on how to properly support multiple versions of Visual Studio:
http://stackoverflow.com/a/25629018/541420
There are Nuget packages for this!

@jeremysimmons
Copy link
Collaborator

Support Multiple Versions cleanly.

@jeremysimmons
Copy link
Collaborator

Moving build enhancement "Support Multiple Versions cleanly" to new Issue.

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

No branches or pull requests

6 participants