.NET CLR 2.0 vs CLR 4.0 usage

Curious, if you created an .NET application using the  2.0 net framework, and it used say the dll called System.Data.dll. This dll would be found in the directory
c:\windows\Microsoft .Net\Framework\v2.0.50727\ .
So if you solely change the runtime in your app.config file  to V4.0.30319, would your program load the System.Data.dll found in
c:\windows\Microsoft .Net\Framework\v4.0.30319\ .

Or would it stick to the version  in c:\windows\Microsoft .Net \Framework\v2.0.50727\  ?
And I guess what I am saying is ---is the CLR looking for the exact strong name of the dll that was used when the application was built?
Lawrence AverySystem DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Melih SARICAOwnerCommented:
Yes IF ur not using particular dll that is copied to bin directory(3rd party dll's) when u change the configuraion of ur project from .net2.0 .net4.0 all dll's using the framework assemblies ll be changed to target framework
0
Lawrence AverySystem DeveloperAuthor Commented:
When I mean change my configuration, I mean in the app.config file not the properties window in Visual Studio.  But the app.config file like so:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
     <supportedRuntime version="v4.0.30319"/>
  </startup>
</configuration>

So it ignores the strong name of the dll????
0
Lawrence AverySystem DeveloperAuthor Commented:
I found by changing the runtime in the app.config does change what version of .NET Library you are using.
See the attached file. You can take the code and plug it in to a c# console application project and add the app.config to it. By changing the version of the runtime in the app.config , it will change the version of the dlls used. However, I haven't tested the situation where say the possibility of the dll in the later version of the runtime might be archived and removed. I am not sure what happens there. Maybe you can use a codebase in your app.config for a particular module if it is only in the older version of the .NET Framework. I am not sure yet. Need to test that situation.
Using-different-CLRs-2-to-4.txt
0
Melih SARICAOwnerCommented:
Thats what im saying on my comment.
.NET CLR did not import assemblies in the GAC or bin folder. It only reference these dll's with Framework and name .. so in what version u target in ur config that version ll run
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.