473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to detect .Net running version

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\mscor wks.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!
Nov 20 '05 #1
5 3503
The asnwer lies in the project file. I have used this successfully

http://www.codeproject.com/macro/vsc...&select=629778
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Atara" <At***@DD.com> wrote in message
news:e3**************@TK2MSFTNGP10.phx.gbl...
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\mscor wks.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!

Nov 20 '05 #2
ISK
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..

"Atara" wrote:
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\mscor wks.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!

Nov 20 '05 #3
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!
Nov 20 '05 #4
* Atara <At***@DD.com> scripsit:
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\mscor wks.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"?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #5

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!
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Stephane Belzile | last post by:
Is there a way I can detect in vb.Net the power has switched to a UPS unit in case of power failure? Thanks
5
by: Andy | last post by:
Hi, I'm trying to use javascript to detect the version of internet explorer before running an active x control. I'm after the full version number (eg not just IE6 but 6.0.2800.1106). Is there...
10
by: Ben Xia | last post by:
Is there some way can detect MAC address with PHP? any help will be appreciate. Ben
1
by: oreng | last post by:
Hey all, I have some problems detecting whether the client's browser javascript is enabled at the server side. While Request.Browser.JavaScript only check if the browser enable java script (and...
9
by: Rich | last post by:
Please help. Looking for a script to detect and display what version of Windows a user is running. Thanks in advance. Rich
2
by: George | last post by:
I have an app that was built with .net 1.1. It loads but does not work with 2.0. On starting the application I want to add a check to see the version of framework that is running and if it is...
6
by: Fred Hedges | last post by:
Using .NET 1.1, I need to be able to detect if Themes are enabled or disabled, not for a specific application, but for the system as a whole (ie. the current user). The reason I need to be able to...
1
by: mjobbe | last post by:
Hi, I'm creating an MSI for a client app using a Visual Studio Setup Project. I'm trying to detect if Internet Explorer is running on the target computer before I start the installation. How do I...
1
by: Kate77 | last post by:
Hello, Im trying to detect in my application what OS it is running. I found this code: // Get the Operating System From Environment Class OperatingSystem os = Environment.OSVersion; // Get...
7
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi all, misters, I have Windows App .net 2.0 + vs 2005. My form launch several MSI's (app1.msi, app2.msi). I try launch MSI using Process.Start. I need know when detect MSI executable has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.