[英]How to reference/use Resource Dictionary between multiple projects inside solution
[英]How to reference a class between projects in a Web solution
我有一個項目存儲一個Address類,我想同時使用Web Service項目和Web項目。
項目1 :(持有地址類別)
namespace GeoClass
{
public partial class Address
{
private string city { get; set; };
private string street { get; set; };
private string zip { get; set; };
}
}
Web服務項目:我添加了GeoClass作為參考
using GeoClass; namespace WSGeo { public class jsonGeo : System.Web.Services.WebService { [WebMethod} public jsonOut GetAddress(Address inputAddr) { //do something } } }
在Web應用程序中,將WebService項目添加為Web服務,然后添加Project 1作為引用。 我這樣調用Webservice中的方法:
using GeoClass; Address inputAddress = GetInputAddress(); //This function pull the data from the text boxes string WSResult; WSGeo jsonGeo = new WSGeo; WsResult = WS.jsonGeo.GetAddress(inputAddress); // I have in invalid argument error right here
我在這里想念什么嗎? 謝謝
我在這里找到了答案: C#Web服務和網站共享庫,服務返回庫對象的不同“類型”
我只有Web應用程序框架3.5(庫和Web服務項目是框架4.5)才有這個問題,當我用框架4.5(另一個Web應用程序,Web服務和庫)構建另一個項目時,我還沒有遇到過這個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.