C# · Dotnet

Error in adding some GAC assemblies to Visual Studio TIP

Dear Reader,

Yesterday was, for a while pretty frustrating moments for me. Because, i had to add a assembly from GAC i.e System.Data.Linq for example: Yea, so whats frustrating you might ask? Well read on.

I was working on .NET 3.5 framework in VS 2008. So as usual, i added a static reference to the assembly from Add Reference dialog of Visual Studio. Then the added assembly started to show an error in the references list as shown below:

This issue started to bug me up for a while, i was under a pressure of completing the assigned task and this issue hold me up bad.

I tried googling, i tried asking couple of smart colleagues around and no use. Next, I tried looking for the path of this assembly. I noticed a bit difference in it.

As you can see from the above screen, the assembly what i want does reside in a different path than the normal system core assemblies like System.Data, though it was a bit of surprise to me but i thought thats how its been done by M$. But this made me a bit curious as this path could be making VS to show this error or some registry contents did not got updated or some thing? Oh well, googling, and searching further did not help either, neither could my colleagues spot out the issue.

We tried changing the framework from 3.5 to 2.0 and back again, though it did solve the error, but we could not find why or whats causing this issue, because repeating this use case again did put us in the same unresolved state.

After about 2 hrs of searching and headache, i managed to find this simple thing which was causing the problem. I just had to uncheck the “client only subset…” option in the project properties.

I never knew this small feature was causing the issue though i went through this option earlier. Finally felt a bit relaxed after fixing this mysterious issue πŸ™‚

Hope it was helpful to you. Happy Coding..
Zen πŸ™‚

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s