none
wcf 指定端口运行 RRS feed

  • 问题

  • 为什么下面指定端口为8731, 在试运行 wcf , 页面显示的端口 不是 8731

    <baseAddresses> 

    <addbaseAddressaddbaseAddress="http://localhost:8731/Design_Time_Addresses/MyWCFService/"/> 

    </baseAddresses> 

    2010年3月26日 0:16

答案

  • 为了使没有管理员权限的用户能够开发 WCF 服务,在安装 Visual Studio 的过程中为命名空间“http://+:8731/Design_Time_Addresses”创建了一个 ACL(访问控制列表)。该 ACL 被设置为“(UI)”,这将包括登录到此计算机的所有交互用户。管理员可以在此 ACL 中添加或移除用户,或者打开其他端口。此 ACL 使用户可以在无管理员权限的情况下使用 WCF 服务自动主机 (wcfSvcHost.exe)。

    可以使用提升的管理员帐户在 Windows Vista 中通过 netsh.exe 工具来修改访问权限。下面是使用 netsh.exe 的示例。

    http://msdn.microsoft.com/zh-cn/library/bb552363.aspx

    可以参考这个文章:

    http://blogs.msdn.com/cesardelatorre/archive/2008/01/27/design-time-addresses-url-in-wcf-net-3-5.aspx

    http://blog.csdn.net/bitfan/archive/2009/05/16/4193319.aspx

    Design_Time_Addresses URL in WCF (.NET 3.5)

    .NET 3.5 creates an ACL (Access Control List) for the namespace "http://+:8731/Design_Time_Addresses" during the installation of Visual Studio so users without administrator privilege are able to develop WCF services. The ACL is set to (UI), which includes all interactive users logged on to the machine. Administrators can add or remove users from this ACL, or open additional ports.

    This ACL enables WCF or WF templates to send and receive data in their default configuration. It also enables users to use the WCF Service Auto Host (wcfSvcHost.exe) without granting them administrator privileges.

    You can modify access using the netsh.exe tool in Windows Vista under the elevated administrator account. The following is an example of using netsh.exe.

    netsh http add urlacl url=http://+:9002/MyService user=<domain>\<user>

    TIP: If you are developing as Administrator and also you have disabled Windows Vista UAC (User Account Control), then you shouldn't have to deal with this matter. You could choose any URI you want. But, you'd better do a good testing with no Administrators users before deploying your WCF Service, or you'll be facing this security control when you don't have time to deal with it (deployment phase, production environment, etc.). ;-)


    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
    欢迎访问老徐的中文技术博客:Welcome to My Chinese Technical Blog
    欢迎访问微软WCF中文技术论坛:Welcome to Microsoft Chinese WCF Forum
    欢迎访问微软WCF英文技术论坛:Welcome to Microsoft English WCF Forum
    • 已标记为答案 lfj0912 2010年3月27日 7:29
    2010年3月26日 12:33
    版主

全部回复

  • 为了使没有管理员权限的用户能够开发 WCF 服务,在安装 Visual Studio 的过程中为命名空间“http://+:8731/Design_Time_Addresses”创建了一个 ACL(访问控制列表)。该 ACL 被设置为“(UI)”,这将包括登录到此计算机的所有交互用户。管理员可以在此 ACL 中添加或移除用户,或者打开其他端口。此 ACL 使用户可以在无管理员权限的情况下使用 WCF 服务自动主机 (wcfSvcHost.exe)。

    可以使用提升的管理员帐户在 Windows Vista 中通过 netsh.exe 工具来修改访问权限。下面是使用 netsh.exe 的示例。

    http://msdn.microsoft.com/zh-cn/library/bb552363.aspx

    可以参考这个文章:

    http://blogs.msdn.com/cesardelatorre/archive/2008/01/27/design-time-addresses-url-in-wcf-net-3-5.aspx

    http://blog.csdn.net/bitfan/archive/2009/05/16/4193319.aspx

    Design_Time_Addresses URL in WCF (.NET 3.5)

    .NET 3.5 creates an ACL (Access Control List) for the namespace "http://+:8731/Design_Time_Addresses" during the installation of Visual Studio so users without administrator privilege are able to develop WCF services. The ACL is set to (UI), which includes all interactive users logged on to the machine. Administrators can add or remove users from this ACL, or open additional ports.

    This ACL enables WCF or WF templates to send and receive data in their default configuration. It also enables users to use the WCF Service Auto Host (wcfSvcHost.exe) without granting them administrator privileges.

    You can modify access using the netsh.exe tool in Windows Vista under the elevated administrator account. The following is an example of using netsh.exe.

    netsh http add urlacl url=http://+:9002/MyService user=<domain>\<user>

    TIP: If you are developing as Administrator and also you have disabled Windows Vista UAC (User Account Control), then you shouldn't have to deal with this matter. You could choose any URI you want. But, you'd better do a good testing with no Administrators users before deploying your WCF Service, or you'll be facing this security control when you don't have time to deal with it (deployment phase, production environment, etc.). ;-)


    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
    欢迎访问老徐的中文技术博客:Welcome to My Chinese Technical Blog
    欢迎访问微软WCF中文技术论坛:Welcome to Microsoft Chinese WCF Forum
    欢迎访问微软WCF英文技术论坛:Welcome to Microsoft English WCF Forum
    • 已标记为答案 lfj0912 2010年3月27日 7:29
    2010年3月26日 12:33
    版主
  • http://msdn.microsoft.com/zh-cn/library/bb552363.aspx

    谢谢您! 为什么这个网址打不开?

    2010年3月26日 13:36
  • 我可以啊
    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
    欢迎访问老徐的中文技术博客:Welcome to My Chinese Technical Blog
    欢迎访问微软WCF中文技术论坛:Welcome to Microsoft Chinese WCF Forum
    欢迎访问微软WCF英文技术论坛:Welcome to Microsoft English WCF Forum
    2010年3月27日 4:10
    版主