Gaurav Agrawal
Gaurav Agrawal

Reputation: 4431

In Class Library Project missing "System.ServiceModel"

I have a Class Library project which is made in 3.5 framework. Now I want to update this project into framework 4.0. By using project property I have changed this project from 3.5 into 4.0 Target framework. Now it gives me an error i.e.

Error : The type or namespace name 'ServiceModel' does not exist in the namespace 'System' (are you missing an assembly reference?)

Before this when this project in 3.5 framework it builds successfully but after changing 4.0 framework it throws this error.

I made a new reference of System.ServiceModel of 4.0.0.0 version like this : enter image description here

but after that adding this new System.ServiceModel dll it shows the same error like this : enter image description here

How can I converted this 3.5 project into 4.0?

How can Resolve this error?

Upvotes: 2

Views: 1720

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038790

The steps you have described seem correct. The yellow question mark should disappear after you compile.

  1. Change the target .NET framework from .NET 3.5 to .NET 4.0 (not .NET 4.0 Client Profile otherwise the System.ServiceModel assembly will not appear in the Add Reference dialog)
  2. Add reference to System.ServiceModel 4.0.0.0 to the project

Upvotes: 2

Related Questions