mmk_open
mmk_open

Reputation: 1035

Windows Form Application convert to .Net Framework 4.0 to 2.0

While creating a Windows Form Application, I selected target to .Net Framework 4.0. Now I would like to build it to .Net Framework 2.0. How can I do it using Visual Studio 2010?

It is a VB.Net project. I could not see "Target Framework". For my C# projects, I can see the "Target Framework" property.

Upvotes: 7

Views: 16335

Answers (4)

Masaddy
Masaddy

Reputation: 1

i've been try to upgrade my project from .net 2.0 to 4.0, and yeah the reference is still targeting .net 2.0. The solution open *.csproj (project file) with notepad, and change

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="2.0">

into

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">

Hope this help

Upvotes: 0

Alex Aza
Alex Aza

Reputation: 78457

For C# project, if you go to the project properties, you will find Target Framework on Application tab. Switch it to .NET Framework 2.0.

enter image description here

Try to build and remove unsupported namespaces.

If you used any features specific to .NET 4, you will have to fix it manually.

[Edit] As you mentioned that you use VB.NET.

For VB.NET go to project properties, hit Advanced Compile Options... to the Compile tab.

enter image description here

Select target framework:

enter image description here

Upvotes: 16

Russell
Russell

Reputation: 17719

In my experience after switching the target framework, the core references will not be updated.

For example I changed from C# library 4.0 back to 3.5 (so I could work it with SP2010), and found it left CSharp.exe (a 4.0 assembly) as an undefined reference.

I recreated it from scratch and found the set of core references is different.

To be safe, I would recommend recreating your project and re-adding the project files after.

But who knows, you may get lucky. :D Good luck!

Upvotes: 0

Duncan Smart
Duncan Smart

Reputation: 32058

Right click the project in Solution Explorer and go to properties change the Target framework in the Application tab.

Upvotes: 2

Related Questions