VB.NET System.Environment.Version different than target framework

I have a console program where I have set the Target Framework (all configurations) in the Advanced Compile Options to use .NET Framework 3.5. However, when I place MsgBox(System.Environment.Version.ToString) in my code it shows 2.0.50727.5485.

We have an issue with connecting to a web service that the provider suggests might be related to the version of the framework we are using. I'm trying to confirm that we are indeed using 3.5.  

Am I displaying the wrong variable in my code or is it really using 2.0? If it is using 2.0, is there something different I need to do to force it to use 3.5?
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.

The only true way to know which version of the framework your assembly is built for is to look at the assembly manifest.  One way you can do this is by using ILDASM -Capture.JPGNotice the System.Core version is your next question is why does System.Environment.Version display 2.0.50727.5485?

Quite simply because the version of the Common Language Runtime is in fact, 2.0.50727.5485 (which is what Environment.Version reports).Capture.JPGThe same thing happens when you target .NET 4.5, System.Environment.Version displays 4.0.30319.42000; e.g. -Capture.JPGMicrosoft even notes that this is expected behaviour:Capture.JPG- Source


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
David Johnson, CD, MVPRetiredCommented:
what you are seeing is the .net clr version and not the net framework version
railcrewxpressAuthor Commented:
Thank you for your help!
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
Visual Basic.NET

From novice to tech pro — start learning today.