简体   繁体   English

在Visual Studio 2010中将2.0 Web参考与.net 4.0项目一起使用

[英]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.

相关问题 如何使 Visual Studio 2010 在 Windows 电话项目上使用 .NET 4.0 而不是 .NET 2.0? - How to make Visual Studio 2010 use .NET 4.0 instead of .NET 2.0 on a Windows Phone project? 在Visual Studio 2010中使用.Net 2.0 Web引用 - Using a .Net 2.0 Web Reference in Visual Studio 2010 Visual Studio 2010中的安装项目需要.NET 4.0 - Setup Project in Visual Studio 2010 Requires .NET 4.0 我可以使用Visual Studio 2010而不是升级到.NET Framework 4.0吗? - Can I use Visual Studio 2010 and not upgrade to .NET Framework 4.0? 将网站从.NET 2.0升级到.NET 4.0会在Visual Studio中打开网站时发出警告“此项目的目标是ASP.NET 2.0 ...” - Upgrading a web site from .NET 2.0 to .NET 4.0 gives warning when opening web site in Visual Studio “This project is targeting ASP.NET 2.0…” Visual Studio 2010无法识别.NET Framework 4.0 - Visual Studio 2010 not recognizing .NET Framework 4.0 Visual Studio 2010和.NET 4.0客户端配置文件 - Visual Studio 2010 and .NET 4.0 Client Profile .NET 4.0的Visual Studio 2010问题 - Visual Studio 2010 Problem with .NET 4.0 Visual Studio 2010错误:打开.NET 4.0项目时“未安装项目目标框架” - Visual Studio 2010 error: “Project Target Framework Not Installed” when opening a .NET 4.0 project 在Visual Studio 2010框架4.0中使用扩展WPF工具包2.0 - using Extended WPF toolkit 2.0 in visual studio 2010 framework 4.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM