55

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

3
  • 2
    Did you add a reference to it? Select Project-> Add Reference and select the assembly name.
    – Mamta D
    Apr 13, 2011 at 9:54
  • yep...didn't do that. THANKS !
    – Yonatan K
    Apr 13, 2011 at 9:58
  • Here is a similar problem. I solved using this method. stackoverflow.com/questions/7511199/…
    – manas
    Sep 19, 2012 at 4:47

4 Answers 4

85

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

2
  • Thank you for your answer! Helped me alot! Jan 3, 2019 at 11:18
  • 1
    Does not appear to be an option in 2021.
    – Loophole
    Sep 30, 2021 at 5:42
15

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

6

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.

3

Sometimes Visual Studio doesn't install this dll in GAC.
You can gac what is located in %systemDrive%\Windows\Microsoft.NET\Framework\v4.0.30319 using gacutil /i dll_file
To use gacutil you can open Command Prompt from Visual Studio Tools menu.

1
  • I think you mean gacutil /l ?
    – Paul
    Nov 6, 2013 at 11:25

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.