Application has generated an exception that could not be handled...

  • Thread starter Thread starter Andy Bates
  • Start date Start date
A

Andy Bates

Hi -

I'm developing a .NET Win Forms application on XP. Service packed up to the
hilt including .NET 1.1 SP1 and .NET 1.0 SP3.

I've just tried running it on an XP machine and I get the above message
appearing! This machine only has .NET 1.1 SP1 installed (no .NET 1.0). I
installed .NET 1.0 and it works fine.

On trying a Win 2000 Pro machine I get the same problem. I've installed .NET
1.0/1.1 and all SPs but it still reports the same problem.

I've created a .exe.config file and on the development box can switch .NET
versions (application reports .NET version by System.Environment.Version) by
amending the settings in this.

The application is dependent on an ActiveX (via interop) and a third party
component. The question I have is:

1. Can a .NET application require two versions of .NET (i.e. one for itself
and other components it uses use another version) or do they all use the
same version?

2. What do I need to do to get it running on the Win 2000 Pro machine? BTW I
also need to go back to Win 9X, so I envisage having the same problems
here...

3. Where can I configure the .NET version to use in the IDE?

4. How can I see what version of the .NET framework a component is
targetting?

TIA

- Andy
 
Hi Andy,

Please see inline comments.

Andy Bates said:
Hi -

I'm developing a .NET Win Forms application on XP. Service packed up to the
hilt including .NET 1.1 SP1 and .NET 1.0 SP3.

I've just tried running it on an XP machine and I get the above message
appearing! This machine only has .NET 1.1 SP1 installed (no .NET 1.0). I
installed .NET 1.0 and it works fine.

On trying a Win 2000 Pro machine I get the same problem. I've installed ..NET
1.0/1.1 and all SPs but it still reports the same problem.

I've created a .exe.config file and on the development box can switch .NET
versions (application reports .NET version by System.Environment.Version) by
amending the settings in this.

The application is dependent on an ActiveX (via interop) and a third party
component. The question I have is:

1. Can a .NET application require two versions of .NET (i.e. one for itself
and other components it uses use another version) or do they all use the
same version?

Your application can use both version of the .NET framework
side-by-side.
2. What do I need to do to get it running on the Win 2000 Pro machine? BTW I
also need to go back to Win 9X, so I envisage having the same problems
here...

All you need is the framework + your registered 3rd party component +
its interop file. When you say Win 9x, I assume you mean Win 98 SE upwards
(ie. Win 98 SE & Win Me).
3. Where can I configure the .NET version to use in the IDE?
Choose a Project >> right click and select Properties >> Common
Properties >> General >> Supported Runtimes. Choose the elipsis and it will
provide you options to select v1.1 (default), v1.0 or both.
4. How can I see what version of the .NET framework a component is
targetting?

If you are using VS.Net 2002, it targets v1.0 (by default) and VS.NET
2003 - v1.1 (by default).
TIA

- Andy

Regarding the error message, could you paste a more verbose version of
it.

HTH,
-Azhagan
 
Back
Top