Click here to Skip to main content
15,886,816 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Hello All,

I have developed an application with .Net Framework 3.5.
In this application, i am using System.Xml.Linq.
Everything is working fine at my machine.
But my client has (ONLY) .Net framework 4.0 installed on his machine, and when he is trying to run application, an error is coming as "could not load file or assembly System.xml.linq version=3.5.0.0".

Do i need to add System.Xml.Linq assembly into GAC on client's machine?
If yes, is System.Xml.Linq is a shared assembly or private assembly?

Can anybody tell me how can i make my application run on my client's machine which has ONLY .Net Framework 4.0 installed and my application built in .Net Framework 3.5.

<--update-->

My client don't have Visual Studio installed, so i can't run gacutil command there.
Can anybody tell me how can i run gacutil without Visual Stdio command prompt.
<--update-->


Thanks,
Nagendra.
Posted
Updated 26-Apr-11 21:11pm
v2

You have to recompile your solution to .NET 4 Framework to make it work.
Alternative your client has to install .NET 3.5 Framework.
 
Share this answer
 
System.Xml.Linq is a shared assembly and I think it comes with .Net Framework 3.5. So may be you have to install .net framework 3.5. OR you can try after copying this assembly to GAC. This may work
 
Share this answer
 
Comments
nagendrathecoder 27-Apr-11 3:09am    
My client don't have Vishual Studio installed, so i can't run gacutil command there.
Can you tell me how can i run gacutil without Visual Stdio command prompt.
nit_singh 27-Apr-11 4:54am    
See my solution for this..It might work..
You can force your app to use version 4.0 by adding this to your App.Config file

XML
<configuration>
   <startup>
      <supportedRuntime version="v4.0"/>
   </startup>
</configuration>


Hope this helps
 
Share this answer
 
Comments
Kim Togo 26-Apr-11 14:07pm    
My 5. Good answer.
http://stackoverflow.com/questions/3953063/how-to-force-an-application-to-use-net-3-5-or-above
nagendrathecoder 27-Apr-11 6:09am    
This link solved mt problem. Thanks :)
Dalek Dave 27-Apr-11 3:35am    
Good Call.
If you want to open Visual Studio command promt without having VS, Then you can try like this. It might work for you.
Step1: First open command prompt using cmd command
2: Now go to "cd C:\Program Files\Microsoft Visual Studio 9.0\VC" and you can find a batch file with name "vcvarsall.bat". Type the name and press ENTER.
3. And now you can RUN any .net commands like "SN", "GACUTIL" any thing.

Try once and responde if it is working for you
 
Share this answer
 
Comments
nagendrathecoder 27-Apr-11 6:08am    
Sorry but i couldn't find vcvarsall.bat. :(
Hi,
in order to use gacutil your client should install the .NET SDK - http://www.microsoft.com/downloads/en/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec&displaylang=en[^], it comes with the associated tools.
Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900