简体   繁体   中英

Rename WCF service source file

Can we rename the Service.svc ? When we create a new WCF Service the default name is Service1.svc . I tried to change it to CatalogueService.svc but started getting errors when I tried to run it. Is it because I changed the file name? Do I have to make changes in the files too? And how can I make these changes everywhere at once? I tried to Update my Service Reference and got error:

Unable to connect to the remote server. No connection could be made because the target machine actively refused it

This will work:

1) Delete Default Service1.cs file. 2) Add new Class file-> Rename it. 3) Implement that interface.

class YourNewClassName:IService1
{
    public void DoWork()
    {
        throw new NotImplementedException();
    }
}

or CLICK YES to this option

在此处输入图片说明

Update configuration in your client service reference. You have ../Service1.svc but should be .../CatalogueService.svc

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