Jack Kada
Jack Kada

Reputation: 25242

Compiling Code For .Net 2.0 - What Happens If Client Does Not Have This Installed - Will It Default?

If I compile a code and target the C# 2.0 platform and the client only has .NET 3.5 will this application load and run?

EDIT: I know that .NET is backwards compatible - But my question still remains. If I build this and target framework .net 2.0 but the client has only .NET 4, will the CLR load this and run this with the .NET 4 CLR?

Upvotes: 0

Views: 91

Answers (3)

Vladimir Perevalov
Vladimir Perevalov

Reputation: 4157

There are some quirks with thos versioning scheme. Basically there are three CLR runtimes: CLR 1 (shipped with .Net 1-1.1). CLR 2 (shipped with .Net 2.0-3.5). CLR 4 (shipped with .Net 4). All that is between those number are only incremental changes to the libraries. So in your example .Net 3.5 is just the same .Net 2.0, but that have more libraries included. Generally this is not a problem, because you can package your project in a way, that it will include any libraries except for .Net 2.0. And it will work on any .Net 2.0 installation. Microsoft claims

That .Net is fully backward compatible. I.e. you can even run .Net 1.1 apps on .Net 4.0. But they say, there may be some problems. In your case it should be fine, but you have to perform particular tests before you claim this to work.

Upvotes: 0

marc_s
marc_s

Reputation: 754953

.NET 3.5 IS .NET 2.0 - with additional libraries included. So you should be fine here.

Upvotes: 2

Fischermaen
Fischermaen

Reputation: 12468

No, it will not fault. Version 2.0 is included in version 3.5.

Upvotes: 0

Related Questions