简体   繁体   English

System.ServiceModel引用

[英]System.ServiceModel References

I'm trying to use System.ServiceModel 我正在尝试使用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 在C#winform桌面应用程序中,但我在Visual Studio 2015中找不到它将它添加到项目References中,这必须是Framework中的System.SeviceModel我猜,不确定

Any advice would be useful 任何建议都会有用

Update your project target framework to .NET 4.5 by Right clicking your project, going to properties, then application, then target framework. 通过右键单击项目,转到属性,然后是应用程序,然后是目标框架,将项目目标框架更新到.NET 4.5。 Change the target framework to .NET Framework 4.5. 将目标框架更改为.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. 在我的VS2015实例中,当我转到Add References-> Assemblies时,System.ServiceModel就在那里,它看起来在C:\\ Program Files(x86)\\ Reference Assemblies \\ Microsoft \\ Framework.NETFramework \\ v4.5文件夹中。

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. 如果System.ServiceModel不在列表中,您可以尝试通过右键单击 - >管理NuGet包 - >浏览获取它,并搜索ServiceModel,从Microsoft获取。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM