[英]WCF Service Not Updating (Multi project, same solution)
I'm having a bit of trouble getting my WCF service reference from project A to reflect changes in project B. 我在从项目A获取我的WCF服务参考以反映项目B中的更改时遇到了一些麻烦。
I have both the service reference and a standard reference to the DLL of the service reference project. 我既有服务参考,也有对服务参考项目DLL的标准参考。
When making changes to the service library, these changes are not propogated, it would seem, to my client application. 对服务库进行更改时,这些更改似乎不会传播到我的客户端应用程序。 Here is an example:
这是一个例子:
This is an example of one class that I just updated with a new 'test' constructor, that resides in the service library: 这是我刚刚使用服务库中的新“测试”构造函数更新的一个类的示例:
[DataContract]
public class TransactionUploadResult {
[DataMember]
public string Transaction_ID;
[DataMember]
public bool Error;
public TransactionUploadResult(string id, string temp, bool error) {
Transaction_ID = id;
Error = error;
}
public override string ToString() {
return "TID:" + Transaction_ID + ", " + (Error ? "ERROR" : "SUCCESS");
}
}
Notice the superfluous second parameter 'temp' in the constructor. 注意构造函数中多余的第二个参数“ temp”。
Now here is a snippet from my client code (in a different project, same solution): 现在这是我的客户代码的片段(在另一个项目中,相同的解决方案):
private void button1_Click(object sender, EventArgs e) {
TransactionUploadResult tur = new TransactionUploadResult("test", true);
MessageBox.Show(tur.ToString());
MessageBox.Show(RemoteHandler.ServiceClient.UploadTransaction(new Transaction()).ToString());
}
UploadTransaction() returns a TransactionUploadResult. UploadTransaction()返回TransactionUploadResult。 The MessageBoxes both show standard ToString() results for user-defined objects, NOT the ones I have defined in TransactionUploadResult.
消息框都显示用户定义对象的标准ToString()结果,而不是我在TransactionUploadResult中定义的结果。
The fact that the client even compiles and runs (considering it's using an outdated constructor) surprises me. 客户端甚至可以编译并运行(考虑使用了过时的构造函数)这一事实使我感到惊讶。
What's going wrong? 怎么了 Thanks in advance.
提前致谢。
我认为您必须右键单击客户端应用程序中的服务引用,然后选择“更新服务引用”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.