This is known by many who have been doing VSX for a while, but I ran into it again recently and thought since many are no getting into this fresh, more sources are good.

 

Visual Studio Automation and Extensibility

If you create a project that references one or more of the VSLangProj assemblies and the EnvDTE assembly, you can occasionally get the following error at runtime:
“Unhandled Exception: System.IO.FileNotFoundException: Error while loading file ‘EnvDTE, Version=7.0.3300.0″
This error is due to a runtime type resolution conflict. That is, the version of EnvDTE that is included with Visual Studio 2005 is 8.0.xx, but the project’s configuration reference is looking for an earlier version of this assembly, version 7.0.xx.
To fix this problem, you must add a binding redirect for the newer version of EnvDTE to your project’s configuration (.config) file. This will enable Visual Studio to load the newer version of EnvDTE and prevent the error from occurring.To do this, add an “Application Configuration File” to your project and then replace its contents with the following:This error occurs only if you are building an EXE, since DLL’s do not have config files.

 

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft- com:asm.v1"
appliesTo="v2.0.50318">
<dependentAssembly>
<assemblyIdentity name="EnvDTE" publicKeyToken= "b03f5f7f11d50a3a"/>
<bindingRedirect oldVersion="7.0.3300.0" newVersion="8.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

 


One Trackback/Pingback

  1. By coping dvds on 06 Jun 2008 at 1:38 pm

    coping dvds…

    X- StartupManager (consente di visualizzare e gestire tutti i programmi che vengono eseguiti all’…

Post a Comment