What happens if a .NET 3.5 .exe file is executed on a computer that only has
..NET 2.0? Does the user get a meaningful error message? 11 1482
On Jul 25, 7:15*am, "MC" <for.address.l...@www.ai.uga.edu.slash.mc>
wrote:
What happens if a .NET 3.5 .exe file is executed on a computer that only has
.NET 2.0? *Does the user get a meaningful error message?
To my surprise, one .exe created with express edition using 3.5, ran
successfully on a machine having framework 2.0. I was expecting an
error....
-Cnu
On Jul 25, 6:15*am, "MC" <for.address.l...@www.ai.uga.edu.slash.mc>
wrote:
What happens if a .NET 3.5 .exe file is executed on a computer that only has
.NET 2.0? *Does the user get a meaningful error message?
There is no such thing as a ".NET 3.5 .exe file" - any assembly you
build targeting .NET 3.5 is binary compatible with .NET 2.0 (because
both use the same 2.0 runtime). The only difference may be that .NET
3.5 assembly can reference some of the new assemblies from 3.5. In
this case, and if you actually try to use anything from those
referenced assemblies, you'll get the exact same error as for a
missing library. If you do not use any 3.5 assemblies, it will just
run.
Note that you can register your own handler for
AppDomain.AssemblyResolve event to detect missing assemblies and
provide your own error message if the assembly is a 3.5 one.
"Pavel Minaev" <in****@gmail.comwrote in message
news:a3**********************************@r35g2000 prm.googlegroups.com...
wrote:
--------------
What happens if a .NET 3.5 .exe file is executed on a computer that only
has
.NET 2.0? Does the user get a meaningful error message?
There is no such thing as a ".NET 3.5 .exe file" - any assembly you
build targeting .NET 3.5 is binary compatible with .NET 2.0 (because
both use the same 2.0 runtime). The only difference may be that .NET
3.5 assembly can reference some of the new assemblies from 3.5. In
this case, and if you actually try to use anything from those
referenced assemblies, you'll get the exact same error as for a
missing library. If you do not use any 3.5 assemblies, it will just
run.
-------------
Thanks. What are the new assemblies?
On Jul 25, 3:00*pm, "MC" <for.address.l...@www.ai.uga.edu.slash.mc>
wrote:
<snip>
There is no such thing as a ".NET 3.5 .exe file" - any assembly you
build targeting .NET 3.5 is binary compatible with .NET 2.0 (because
both use the same 2.0 runtime). The only difference may be that .NET
3.5 assembly can reference some of the new assemblies from 3.5. In
this case, and if you actually try to use anything from those
referenced assemblies, you'll get the exact same error as for a
missing library. If you do not use any 3.5 assemblies, it will just
run.
Not quite. The other possibility is that you might have referenced one
of the .NET 2.0 SP1 classes in existing assemblies - things like
DateTimeOffset. Those will exist on a .NET 2.0SP1 installation, but
not vanilla .NET 2.0.
Jon
On Jul 25, 6:33*pm, "Jon Skeet [C# MVP]" <sk...@pobox.comwrote:
Not quite. The other possibility is that you might have referenced one
of the .NET 2.0 SP1 classes in existing assemblies - things like
DateTimeOffset. Those will exist on a .NET 2.0SP1 installation, but
not vanilla .NET 2.0.
I stand corrected - got bitten by that myself another day, only in my
case it was INotifyPropertyChanging.
But then again, 2.0SP1 is technically still 2.0, and it's available as
a separate download (and installs on all platforms vanilla 2.0 worked
on).
On a side note, I wonder why VS2008 Setup Project uses plain 2.0 and
not 2.0SP1 redistributable if you ask to include the dependencies with
the installer...
What happens if a .NET 3.5 .exe file is executed on a computer that only
has .NET 2.0? Does the user get a meaningful error message?
Here's an answer.
An .EXE targeted for .NET 3.5 will not run on a freshly installed Vista
machine (which I thought would have .NET 3.0). Nor does it give a
meaningful error message to the user. All you get is "So-and-so has stopped
working" and, in the log, an Event 1001, event name CLR20r3, P4=mscorlib,
P5=2.0.0.0.
Not convenient.
MC <fo**************@www.ai.uga.edu.slash.mcwrote:
What happens if a .NET 3.5 .exe file is executed on a computer that only
has .NET 2.0? Does the user get a meaningful error message?
Here's an answer.
An .EXE targeted for .NET 3.5 will not run on a freshly installed Vista
machine (which I thought would have .NET 3.0). Nor does it give a
meaningful error message to the user. All you get is "So-and-so has stopped
working" and, in the log, an Event 1001, event name CLR20r3, P4=mscorlib,
P5=2.0.0.0.
Not convenient.
Well, it will do that in some cases - like if you use a type declared
in .NET 2.0 SP1 or .NET 3.0 SP1, or reference a .NET 3.5 assembly.
If you don't use anything that's not in .NET 2.0 (or 3.0 for Vista) is
should work fine.
--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
>An .EXE targeted for .NET 3.5 will not run on a freshly installed Vista
>machine (which I thought would have .NET 3.0). Nor does it give a meaningful error message to the user. All you get is "So-and-so has stopped working" and, in the log, an Event 1001, event name CLR20r3, P4=mscorlib, P5=2.0.0.0.
Not convenient.
Well, it will do that in some cases - like if you use a type declared
in .NET 2.0 SP1 or .NET 3.0 SP1, or reference a .NET 3.5 assembly.
If you don't use anything that's not in .NET 2.0 (or 3.0 for Vista) is
should work fine.
Is there anything I can put in my program to trap this condition and give a
more useful error message? Or is the failure occurring as the program
loads, before it tries to execute?
In my case, the program uses an extension method, and that seems to be what
trips it.
MC <fo**************@www.ai.uga.edu.slash.mcwrote:
Well, it will do that in some cases - like if you use a type declared
in .NET 2.0 SP1 or .NET 3.0 SP1, or reference a .NET 3.5 assembly.
If you don't use anything that's not in .NET 2.0 (or 3.0 for Vista) is
should work fine.
Is there anything I can put in my program to trap this condition and give a
more useful error message?
Not easily, as far as I know.
Or is the failure occurring as the program loads, before it tries to execute?
I don't know, to be honest. I suggest you try it and see - try to write
code that calls a method in .NET 3.5, and see if you can get it to
execute at all.
My *guess* is that when the class that refers to a .NET 3.5 class is
first initialized, that's when it'll first go bang - but it could be at
the method level, or the whole assembly level...
In my case, the program uses an extension method, and that seems to be what
trips it.
Yes, there weren't any extension methods (or even the attribute) in
..NET 3.0.
--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
On Jul 28, 8:22*pm, "MC" <for.address.l...@www.ai.uga.edu.slash.mc>
wrote:
Is there anything I can put in my program to trap this condition and givea
more useful error message? *Or is the failure occurring as the program
loads, before it tries to execute?
In my case, the program uses an extension method, and that seems to be what
trips it.
Since an extension method translates to an instance of
ExtensionAttribute, and since attributes are (so far as I know)
instantiated when assembly is loaded, it would seem that you can't
catch this particular case no matter what.
Anyway, even if you could trap it, what were you going to do? If your
program needs 3.5, then the most appropriate thing is to create an
installer which checks whether 3.5 is installed, and if not, installs
it, or prompts the user to install it. A simple VS Setup project
should do it.
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP*********************@msnews.microsoft.com. ..
MC <fo**************@www.ai.uga.edu.slash.mcwrote:
Well, it will do that in some cases - like if you use a type declared
in .NET 2.0 SP1 or .NET 3.0 SP1, or reference a .NET 3.5 assembly.
If you don't use anything that's not in .NET 2.0 (or 3.0 for Vista) is
should work fine.
Is there anything I can put in my program to trap this condition and give a more useful error message?
Not easily, as far as I know.
>Or is the failure occurring as the program loads, before it tries to execute?
I don't know, to be honest. I suggest you try it and see - try to write
code that calls a method in .NET 3.5, and see if you can get it to
execute at all.
My *guess* is that when the class that refers to a .NET 3.5 class is
first initialized, that's when it'll first go bang - but it could be at
the method level, or the whole assembly level...
Then have the exe not use any .NET 3.5, but invoke the "real" main method in
a library assembly and catch any exceptions?
i.e. change the current application to a class library project, and invoke
its Main method from a brand new shim.
>
>In my case, the program uses an extension method, and that seems to be what trips it.
Yes, there weren't any extension methods (or even the attribute) in
.NET 3.0.
--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Stevey |
last post by:
I have the following XML file...
<?xml version="1.0"?>
<animals>
<animal>
<name>Tiger</name>
<questions>
<question index="0">true</question>
<question index="1">true</question>
</questions>
|
by: nospam |
last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types,
so, since it seems to me that Partial Types is still in the design or
development stages at Microsoft, I am going to ask...
|
by: Ekqvist Marko |
last post by:
Hi,
I have one Access database table including questions and answers. Now
I need to give answer id automatically to questionID column. But I
don't know how it is best (fastest) to do?
table...
|
by: glenn |
last post by:
I am use to programming in php and the way session and post vars are past
from fields on one page through to the post page automatically where I can
get to their values easily to write to a...
|
by: Rider |
last post by:
Hi, simple(?) question about asp.net configuration..
I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm
first start application the follow message shown.
=========
Server...
|
by: Jeff |
last post by:
In the function below, can size ever be 0 (zero)?
char *clc_strdup(const char * CLC_RESTRICT s)
{
size_t size;
char *p;
clc_assert_not_null(clc_strdup, s);
size = strlen(s) + 1;
|
by: Jeremy S. |
last post by:
In an ASP.NET 1.1 Web application, how can I detect - with *reasonable*
accuracy - whether any particular browser is a downlevel browser?
My objective is to insert a different menu (different...
|
by: spibou |
last post by:
In the statement "a *= expression" is expression assumed to be
parenthesized ? For example if I write "a *= b+c" is this the same
as "a = a * (b+c)" or "a = a * b+c" ?
|
by: Allan Ebdrup |
last post by:
Hi,
I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix
question is a question where you have several options that can all be rated
according to several possible ratings (from...
|
by: Zhang Weiwu |
last post by:
Hello!
I wrote this:
..required-question p:after {
content: "*";
}
Corresponding HTML:
<div class="required-question"><p>Question Text</p><input /></div>
<div...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |