Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I get a .NET 1.1 app to run on .NET 2.0

5 views
Skip to first unread message

David Thielen

unread,
Jan 5, 2005, 9:19:04 AM1/5/05
to
Hi;

We just had a user who has .NET 2.0 installed, but not .NET 1.1. How can we
set our .NET 1.1 app so it will run in a 2.0 only environment?

As I understand it, the startup Element in the application configuration
file contains two elements : required runtime and supported runtime.

However, in my case I am writing a dll that is an add-on to Word. So the
config file is for the application, winword.exe.config and I cannot create
that file as Word is Microsoft's app, not mine.

Is there a way to mark a dll as runnable under .NET 1.1 or later?

--
thanks - dave

Peter Huang [MSFT]

unread,
Jan 6, 2005, 2:53:57 AM1/6/05
to
Hi

Here is a link you may take a look.
HowTo: Control which version of the framework your .NET office add-ins run
under
http://dotnetjunkies.com/WebLog/josephcooney/archive/2004/08/15/22099.aspx

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

David Thielen

unread,
Jan 6, 2005, 12:37:05 PM1/6/05
to
Hi;

I thought of that approach. But what if someone installs two word add-ins, I
create a winword.exe.config saying use .NET 1.1 and the other add-in needs
.NET 2.0. Then when I install second, I have just broken the other add-in.

I was hoping there was a way to set this for just my add-in without changing
things for other add-ins?

thanks - dave

Fredrik Wahlgren

unread,
Jan 6, 2005, 12:57:48 PM1/6/05
to

"David Thielen" <thi...@nospam.nospam> wrote in message
news:1E636372-0679-472A...@microsoft.com...

> Hi;
>
> I thought of that approach. But what if someone installs two word add-ins,
I
> create a winword.exe.config saying use .NET 1.1 and the other add-in needs
> .NET 2.0. Then when I install second, I have just broken the other add-in.
>
> I was hoping there was a way to set this for just my add-in without
changing
> things for other add-ins?
>
> thanks - dave
>
>

I think that DllHell 2.0 happens in this case. I really don't think it's a
good idea to make .NET code that runs on more than one version of .NET. What
is the actual problem? Are the users too lazy to download the proper .NET
version? Is there a policy among potential buyers not to use a particular
.NET version? Are they too cheap to buy a new disk?

Maybe I'm missing something but I would really like to know why you want to
do this.

/Fredrik

David Thielen

unread,
Jan 6, 2005, 4:37:03 PM1/6/05
to
Hi;

You would be surprised how difficult it is to get software installed at
large companies. Basically it doesn't happen unless IT decides it's worth
rolling out to everyone.

My worry is that within a year there will be companies that are .NET 2.0
only while others are .NET 1.1 only. That will be bad in this case.

thanks - dave


"Fredrik Wahlgren" wrote:

>
> "David Thielen" <thi...@nospam.nospam> wrote in message
> news:1E636372-0679-472A...@microsoft.com...
> > Hi;
> >
> > I thought of that approach. But what if someone installs two word add-ins,
> I
> > create a winword.exe.config saying use .NET 1.1 and the other add-in needs
> > .NET 2.0. Then when I install second, I have just broken the other add-in.
> >
> > I was hoping there was a way to set this for just my add-in without
> changing
> > things for other add-ins?
> >
> > thanks - dave
> >
> >
>
> I think that DllHell 2.0 happens in this case. I really don't think it's a
> good idea to make .NET code that runs on more than one version of .NET. What
> is the actual problem? Are the users too lazy to download the proper .NET
> version? Is there a policy among potential buyers not to use a particular

> ..NET version? Are they too cheap to buy a new disk?

Fredrik Wahlgren

unread,
Jan 6, 2005, 4:58:40 PM1/6/05
to

"David Thielen" <thi...@nospam.nospam> wrote in message
news:7CDC3BC0-532D-4070...@microsoft.com...

> Hi;
>
> You would be surprised how difficult it is to get software installed at
> large companies. Basically it doesn't happen unless IT decides it's worth
> rolling out to everyone.
>
> My worry is that within a year there will be companies that are .NET 2.0
> only while others are .NET 1.1 only. That will be bad in this case.
>
> thanks - dave
>
>
> "Fredrik Wahlgren" wrote:
>
I have to admit that I have had some experience with large companies. I
think your best option is to have one project with as many solutions as you
want to target and then let your installation program decide what to
install. I seriously belive that if you create a dll that can work with any
version of .NET, you will end up creating far more problems than you solve.

If you do, you must examine your entire code whenever there's a new version
of .NET. What happens if you have portions of code that work with one
version of .NEt but not with another since the methods now take new
paramaters or have changed in some other way? You would need to use if
statements all over the code to make sure the right one executes depending
on what version of .NET your program chose to work with. How can you make
sure you have tested every line of code for compliance? What a mess!

/Fredrik


Peter Huang [MSFT]

unread,
Jan 7, 2005, 1:13:29 AM1/7/05
to
Hi,

I do not think it is a good practice to run two version CLR in one process.
So far the supportedruntime is exe based setting, that is to say in one exe
we load one version CLR, we can not set it for dll based. And that is why
we provide the config file for winword.exe.config while not the
dllname.config.

Hope this helps.
Usually the app will load the most recently framework, so it is better to
deploy the app for the most recently version unless we did not have the new
one. Also you may try Fredrik's suggestion.

David Thielen

unread,
Jan 10, 2005, 5:45:02 PM1/10/05
to
For a .NET exe I agree. Writing a Word Add-In in .NET is a weird case where
each Add-In could use a different version of .NET and shouldn't conflict as
the .exe is not .NET.

I don't want to build a .NET 2.0 version of each Add-In because we already
have to build a different Add-In for each version of Word so that would take
us from 3 to 6 programs. So I guess we will just tell them they must install
.NET 1.1.

thanks - dave

Peter Huang [MSFT]

unread,
Jan 10, 2005, 10:43:21 PM1/10/05
to
Hi

I think commonly one process can only lauch clr(i.e. 1.1 or 2.0) which we
can consider it as the low level virtual machine to run the MSIL code,
although we can lauch multiple AppDomains which every one use different
version Assembly.

Winword.exe is unmanaged but it will also use the app.config to decide
which version of clr to load(1.1 or 2.0) that is why the app.config is exe
based but no dll. So in the same word process we can not run two addin(one
use 1.1 clr and the other use 2.0 clr).

For detailed information, you may try to take a look at Applied Microsoft
NET framework programming written by Jeffrey Richter.

0 new messages