Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.ServiceModel missing

Tags:

namespaces

c#

I'm working with VS2010 express on Win7 (64 bit) and I'm trying use System.ServiceModel but I get an error that there is no ServiceModel in the System namespace:

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

I looked in \Windows\Microsoft.NET\Framework\v4.0.30319 and there are some ServiceModel___.dll files but I don't know if I'm missing something or if they are corrupted.

Any advice?

Thanks, Yonatan

like image 491
Yonatan K Avatar asked Apr 13 '11 09:04

Yonatan K


People also ask

Where is ServiceModel DLL?

Browse, "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3. 0\System. ServiceModel. dll.

What is System ServiceModel used for?

Provides the base implementation used to create Windows Communication Foundation (WCF) client objects that can call services.


3 Answers

Add a reference to the assembly System.ServiceModel. Select Project-> Add Reference and then select the assembly name.

like image 178
Mamta D Avatar answered Oct 22 '22 06:10

Mamta D


Right click on Project -> Properties -> Application -> Target Framework = .NET Framework 4.5

like image 40
levios Avatar answered Oct 22 '22 06:10

levios


The System.ServiceModel namespace is in System.ServiceModel.dll.

I'm not running 64 bit Windows so I can't check whether that's the right location.

like image 6
ChrisF Avatar answered Oct 22 '22 07:10

ChrisF