Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the WCF port problem

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you how to solve the WCF port problem, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

When we debug a program, we sometimes cause program errors due to port problems. Let's share with you the problem of WCF port. If you use Visual Studio 2008SP1 to develop WCF applications, you will find that when using the new "WCF Service" template of Visual Studio 2008 to add WCF services to the project, Visual Studio 2008 always uses wsHttpBinding binding and uses the address in the following format:

BaseAddresses > host >

There is a mysterious WCF port 8731 and a mysterious address Design_Time_Addresses.

Let's do an experiment:

Turn off the user account control in Vista, then start VisualStudio2008, and add a WCF service (name MyWCFService) to the project based on the new "WCF Service" template. The default service address generated is:

BaseAddresses >

Remove Design_Time_Addresses and change it to:

BaseAddresses >

You will find that there will be no problem with WCF's service startup. However, now open the user account control, use VisualStudio2008 to open and run the same code again, and VisualStudio2008 will complain: change it back to:

Find that the WCF service is ready to start again.

BaseAddresses >

When I first encountered this kind of situation, it was really strange, what is the "mystery" of "8731" WCF port and "Design_Time_Addresses"? It turns out that Visualstudio2008 registered an ACL (AccessControlList) for namespaces during installation, so that current users running Visualstudio (they belong to this ACL) can develop and debug WCF services without Administrator permissions. This reveals that if you need to specify a different WCF service address than the default when developing a WCF service, please run VisualStudio2008 as an administrator. Or, more simply, turn off user account control. I've always found Vista's "user account control" feature really annoying, and it's not necessarily safe with it.

The above content is how to solve the WCF port problem, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 204

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report