views:

159

answers:

3

I have an application, which I develop in VS 2008 and I target .NET 3.

Unfortunately when I install on a clean computer with .NET 3, it crashes. And besides the usual TypeInitilisationError, I have no clue why.

Updating the same machine to .NET 3.5SP1 makes it run fine.

  1. Is there something broken in VS2008 that prevents from telling me a more detailed error?
  2. How can I be sure I don't use any of the newest classes of the framework? It is true that I found myself using DropShadowEffect which belongs to 3SP1. I removed it.

But still...it does not work.

What am I doing wrong?

+2  A: 

Have you tried to determine which version of the framework is installed on each computer. If you're using .Net 3.5 SP1 to compile the program it actually includes .Net 3.0 sp2 which has some extra features (MultiSelector class to name one) which are not available in .Net 3.0 sp1 which is the default install with .Net 3.0 download from Microsoft.

You can try here for some software that will help: NetVersionCheck

EDIT: Visual Studio won't tell you about any errors for this because everything seems fine with the version of .Net 3.0 that it's using. I ran into this problem using the WPF toolkit as it requires the MultiSelector class which didn't arrive until .Net 3.0 sp2. So, Jonathan, if you can show us the error output from your program on the 'Fresh' .Net 3.0 computer then we could probably tell you what you're using that is in .Net 3.0 sp2 that isn't supported in lower versions.

Also, I usually use VS2005 with programs that I want to run under a lower runtime than .Net 3.5sp1, but this really only applies to .Net 2.0 apps.

If we knew what components from .Net 3.0 that you're using, it would help as well!

Noah
A: 

Noah

Thanks for the answer. Because of VS2008, on my dev computer i have the latest 3.5SP1. But in Visual Studio i selected 3 as a target.

And to check i install on a clean computer with 3.0...

So your proposition do tells me which framework is installed, but does not tell me what in my program uses in the newest framework that is not present in 3.0.

Moreover, something must be broken in VS2008 as it should warm me for that...

This is not an answer, either edit your question or leave a comment please.
Geoffrey Chetwood
I think that Noah is correct. Your project is targeting .NET 3.0. On your machine, .NET 3.0 includes .NET 3.0 SP2, which includes components that were added after the original release. VS can't tell the difference, because it can only go by what is on your machine.
Andy
A: 

I feel like this is a problem with VS 2008, but obviously MS feels differently.

VS 2008 comes with .NET 3.5, some .NET 3.0 service pack, and .NET 2.0 SP1. It can only detect whether you are using things that don't belong to a version that is installed on your machine, not whether you are conforming to some service pack. This means that if you target .NET 2.0, but install your software on a machine that does not have .NET 2.0 SP1, if you use anything specific to SP1 your application will fail when it tries to make the call.

The only way to detect this that I have seen is to inspect the changelist of the service packs or to target .NET 3.5. If .NET 3.5 is installed, so are the service packs that come with it. It's not a good solution, but it's the only one I've found.

OwenP