简体   繁体   中英

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.

I have both the service reference and a standard reference to the DLL of the service reference project.

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.

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. The MessageBoxes both show standard ToString() results for user-defined objects, NOT the ones I have defined in 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.

我认为您必须右键单击客户端应用程序中的服务引用,然后选择“更新服务引用”。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM