Thursday, 28 March 2013

How do you resolve the ReferenceManagerPackage failed to load error in Visual Studio?

This is another in a brand new series of videos that I am producing for my new YouTube channel HowDoYouDoStuff.
A channel dedicated to short videos on how to do stuff.


In this video, I am going to show you how to resolve the error "ReferenceManagerPackage failed to load" when trying to add a reference in Visual Studio 2012.


You can read the transcript below.





HTML5 player




Transcript






In this video, I am going to show you how to resolve the error "ReferenceManagerPackage failed to load" when trying to add a reference in Visual Studio 2012.

This morning, I created a new MVC 4 project in Visual Studio 2012 and was attempting to add a reference to System.Security in order to do a demo on cryptography.

Instead of the usual Add a Reference dialog, I received the 'ReferenceManagerPackage' failed to load error message.

This is one of those errors that you get with Visual Studio from time to time that Microsoft are at a loss to explain. In fact, the consensus on the forums seemed to be to reinstall Visual Studio. Well I wasn't about to do that.

I should also point out that I was using one of 6 computers, each of which had been imaged using ghost and so they had an identical build. I was able to reproduce this error on 3 of those machines.

So the solution.

Well perhaps I should call it a work around.

System.Security is already part of .NET and so therefore, adding a reference doesn't involve moving assemblies around. It simply involves adding a reference somewhere.

In this case, the somewhere is the project file. 

Well, they are easy enough to update manually.

I right-clicked the project in the Solution Explorer window and selected Unload Project.

Now that the project was unloaded, I was able to edit it in Visual Studio by right-clicking on the project again in the Solution Explorer window and selecting Edit projectname.csproj.

It is the ItemGroup section that holds all of the references for the project, so I simply needed to add a Reference element to include "System.Security".

With this done, I saved and closed the project file and then once again, right-clicked on the project in the Solution Explorer window and selected Reload Project.

Once I had done that, I could expand references to reassure myself that I had in fact successfully referenced System.Security in my project.

Clearly. This was a work around. It was effective though.

As for the actual problem. In this case, I had a room full of computers imaged with Ghost so there would be no point in reinstalling Visual Studio. However, if it had been my actual  development machine then I would probably have had to reinstall Visual Studio when I managed to find some time.

There you have it.

In this video, I have shown you how to resolve the error "ReferenceManagerPackage failed to load" when trying to add a reference in Visual Studio 2012.




Flash Player










See you soon

Phil Stirpé
"I don't do average!"



1 comment:

  1. Honestly, I've been working in Visual Studio for more than 4 years, and for all this time I had to solve different problems, both after updating to the next advance version and after the Windows rebooting needed to have vcruntime140.dll missing https://fix4dll.com/vcruntime140_dll at all.
    So next time when attempting to open a visual studio project source on another environment, the following dll file error may appear again,
    but now you know for sure where to take such files and how to use them to fix the error as quickly as possible.

    ReplyDelete