[英]Use 2.0 web reference with .net 4.0 project in visual studio 2010
I want to do the following, and any help would be appreciated: 我想做以下事情,任何帮助将不胜感激:
Create a library that uses .net 2.0 runtime to create .net 2.0 web references. 创建一个使用.net 2.0运行时来创建.net 2.0 Web引用的库。
Create a windows forms project that uses .net 4.0. 创建一个使用.net 4.0的Windows窗体项目。 This project will reference and use the web services generated from the 2.0 class library. 该项目将引用和使用从2.0类库生成的Web服务。
I am running into the following issue when compiling the .net 4.0 project: 编译.net 4.0项目时遇到以下问题:
'System.Web.Services.Protocols.SoapHttpClientProtocol' is defined in an assembly that is not referenced. “ System.Web.Services.Protocols.SoapHttpClientProtocol”在未引用的程序集中定义。 You must add a reference to assembly 'System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 您必须添加对程序集'System.Web.Services,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'的引用
The assembly that this error is giving is located in the class library, how can I tell Visual Studio to find it in that library? 该错误给出的程序集位于类库中,如何告诉Visual Studio在该库中找到它?
It is not located in that class library at all. 它根本不在该类库中。 It is referenced by the library. 该库引用了它。 If you want to use 2.0 web services you need reference that assembly in your client library. 如果要使用2.0 Web服务,则需要在客户端库中引用该程序集。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.