C # Winform WCF debugging server programs

Source: Internet
Author: User

C # Winform WCF debugging server programs

Method 1:

Server Settings:

1. Open the solution to be debugged, right-click the WCF server project, and set it as the startup project.

2. Click under this solution

Or press F5 to start the WCF server project.

3. Search for the port number:

I. method 1

After debugging is started, the following interface appears in the browser:

Note the port number in the address bar.

Ii. Method 2:

After the WCF Service project is started, the icon appears in the lower right corner of the desktop, as shown below:

You can also see the port number here. Because I restarted the WCF project once, the displayed port number is different from the one displayed in the browser.

 

Client settings:

4. Open the solution again and set the client as the startup project. In this case, the server is called in the UI project, so the UI project is set as the startup Item.

5. Modify the port number of the WCF reference address in App. config of the UI (based on the port number of the previously started WCF Service Project)

6. Start the UI, that is, the solution where the client is located. At this time, you only need to add a breakpoint to the corresponding function on the server side to track it.

Supplement:

To debug the server in this way, you need to reference the current local WCF Service when the client references the WCF Service. For example, in this case, you can add:

1. Add a service reference where you want to add a reference to a WCF Service:

In the pop-up interface, click and find, vs will automatically find the service in this solution, as shown in

 

OK!

Method 2:

Set up iis debugging locally

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.