1

I'm trying to use System.ServiceModel

using System.ServiceModel; 
using System.ServiceModel.Channels;
using System.ServiceModel.PeerResolvers;

in C# winform desktop application, but I can't find it in Visual Studio 2015 to add it to the project References, which must be System.SeviceModel in Framework I guess, not sure

Any advice would be useful

1 Answers1

0

Update your project target framework to .NET 4.5 by Right clicking your project, going to properties, then application, then target framework. Change the target framework to .NET Framework 4.5.

In my VS2015 instance, when I go to Add References-> Assemblies, System.ServiceModel is there, and it looks to be in the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5 folder.

If System.ServiceModel is not in the list, you can attempt to get it via the Right Click-> Manage NuGet packages-> Browse, and search for ServiceModel, get the one from Microsoft.

JBdev
  • 353
  • 1
  • 10
  • Hello, yes 4.5.2 and I can't find it there, then I tried to find some example code (project) which uses this references just to see it inside, but same result, System.SeviceModel is inside references folder, and it is not marked as lost one with exclamation mark, seems like it should work, but using still says that the name does not exist in the namespace –  May 09 '17 at 15:32
  • I updated my answer to include more information about the framework. Make sure your project targets .NET 4.5 – JBdev May 09 '17 at 15:49
  • yes I did it, it was 4.5.2 now 4.5 but same result, name does not exist in the namespace, and yes, ServiceModel is in the reference list of found project which also was 2.0 and was updated to 4.5, same result. Anyway ServiceModel is not in Assemblies by given path or anywhere else –  May 09 '17 at 16:05
  • I added another method to get it via nuget. – JBdev May 09 '17 at 16:33
  • 1
    Yes, now everything is fine via nuget, thanks for help. –  May 09 '17 at 18:20