How to detect .Net running version

A

Atara

I have an application created in VS 2003.
When I run it on computer with only .Net 1.0 installed, I get -
Title: "Net Framework Initialization Error"
Text: "C:\Win...\Microsoft.Net\Framework\v1.1.4322\mscorwks.dll
could not be loaded"

I tried using the application config file with supportedRuntime,
requireedRuntime, but it did not help!

How can I my application detedt that it tries to run under .Net 1.0 and
not .Net 1.1 , so that I will be able to inform the user a more
meaningful message?


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
G

Guest

Dim o As New System.Runtime.InteropServices.RuntimeEnvironment
MsgBox(o.GetSystemVersion)

this will display the current version of the framework..
you can strip out the major version from that..

hope this helps..
 
A

Atara

There is a 'little' technical problem, I do not get to the first main()
code line. I get this error before my code starts to execute...

cannot I use a certain config flag to detect this ?

This is a windows application, in VS 2003, that I do not want to try to
activate if .Net 1.1 is not installed

Thanks.

Atara



*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
H

Herfried K. Wagner [MVP]

* Atara said:
I have an application created in VS 2003.
When I run it on computer with only .Net 1.0 installed, I get -
Title: "Net Framework Initialization Error"
Text: "C:\Win...\Microsoft.Net\Framework\v1.1.4322\mscorwks.dll
could not be loaded"

I tried using the application config file with supportedRuntime,
requireedRuntime, but it did not help!

What's selected in the project properties -> "General Properties" ->
"Build" -> "Supported Runtimes"?
 
A

Atara

I have -
default, .Net 1.1

and in my app.config file I have
<startup>
<supportedRuntime version="v1.1.4322"/>
<requiredRuntime version="v1.1.4322" safemode="true"/>
</startup>

Thanks.

Atara.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top