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.
Create a windows forms project that uses .net 4.0.开发者_JAVA百科 This project will reference and use the web services generated from the 2.0 class library.
I am running into the following issue when compiling the .net 4.0 project:
'System.Web.Services.Protocols.SoapHttpClientProtocol' is defined in an assembly that is not referenced. You must add a reference to assembly '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?
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.
精彩评论