gpt4 book ai didi

wcf - 更改 WCF 基址

转载 作者:行者123 更新时间:2023-12-04 18:05:28 24 4
gpt4 key购买 nike

默认情况下,我的测试 wcf 应用程序的基地址是

http://localhost:8732/Design_Time_Addresses/evalservice

但是当我删除 Design_Time_Addresses 并使用如下所示的简单基地址时
<add baseAddress="http://localhost:8732/evalservice" />

我收到以下错误
Please try changing the HTTP port to 8732 or running as Administrator.
System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8732/evalservice/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---> System.Net.HttpListenerException: Access is denied

当我将它移回 Design_Time_Addresses 时,问题就解决了。

什么是 Design_Time_Addresses 以及如何将其更改为更简单的基地址?

最佳答案

Design_Time_Addresses 命名空间 is automatically registered by the .NET framework to allow users without administrator privileges to develop WCF services :

You can modify access using the netsh.exe tool [...] 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>



另一种解决方法是以管理员身份运行 Visual Studio。

关于wcf - 更改 WCF 基址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29656367/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com