vendredi 22 janvier 2010

Unable to install or run the application. The application requires that assembly EnvDTE Version 8.0.xx be installed in the Global Assembly Cache (GAC) first.

I was working on a Winforms application that used EnvDTE library version 7.0.xx for Visual Studio automation. The application was developed using .NET 1.1 with Visual Studio 2003.

Recently, I was doing a migration of that application to .NET 3.5 with Visual Studio 2008.

I chose to deploy using ClickOnce deployment.

When I installed it on my machine, it worked. But then, I did a test with an end user machine without any Visual Studio .NET installed.
I got the following error:
Unable to install or run the application. The application requires that assembly EnvDTE Version 8.0.xx be installed in the Global Assembly Cache (GAC) first.

Then, I changed all references of EnvDTE 7.0.xx in my application with EnvDTE version 8.0.xx. I deployed it again to an end user machine.
But I still got the following error:
Unable to install or run the application. The application requires that assembly EnvDTE Version 7.0.xx is installed in the Global Assembly Cache (GAC) first.

I spent some time to fix the problem. But then I found an article in MSDN that helped me to solve the problem.
“This error is due to a runtime resolution conflict. The version on EnvDTE that is included with visual studio 2008 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 that newer version of EnvDTE to your project’s configuration (.config) file.“

I then added to my App.config file the following configuration inside the “runtime” section.
I am now able to deploy the application to end user machines with success.

To learn more : 
http://msdn.microsoft.com/en-us/library/4eeya3de(VS.80).aspx

Aucun commentaire:

Enregistrer un commentaire