引用 .NET 4.0 的 System.ServiceModel 和 System.ServiceModel.Web 库时,我无法实例化 WebHttpBinding 类。我可以在引用 3.5 库时实例化该类。文档说 4.0 支持 WebHttpBinding 那么我做错了什么?
new ChannelFactory<INotesService>
(new WebHttpBinding(),
new EndpointAddress("http://localhost:3380/Service.svc"))
当我点击 CTRL + . 在 WebHttpBinding 上,它没有找到它的命名空间。
http://msdn.microsoft.com/en-us/library/system.servicemodel.webhttpbinding.aspx