通过WCF教程时,我收到以下错误.
HTTP无法注册URL http:// +:8000/ServiceModelSamples/Service /.您的进程没有此命名空间的访问权限(有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkId=70353).
这是由Windows 7的限制引起的吗?
我创建了我的第一个自托管WCF服务.我在C#控制台应用程序中托管它,但它抛出一个错误:
System.ServiceModel.AddressAccessDeniedException:HTTP无法注册URL http:8080
当我以管理员身份运行Visual Studio 2013时,它运行良好,但如果不运行则不行.那么有什么方法可以自动完成它而不是将VS作为ADMIN启动?
到目前为止,我创建了一个HelloService类库,在其中我添加了一个WCF服务,该服务由一个接口IHelloService和HelloService.
IHelloService:
namespace HelloService
{
[ServiceContract]
public interface IHelloService
{
[OperationContract]
String GetMsg();
}
}
Run Code Online (Sandbox Code Playgroud)
HelloService:
namespace HelloService
{
public class HelloService : IHelloService
{
public String GetMsg()
{
return "Service Accessed";
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后我创建了一个C#控制台应用程序HelloServiceHost,它有一个app.config文件:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors >
<behavior name="MexBehaviour">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="HelloService.HelloService"
behaviorConfiguration="MexBehaviour" >
<endpoint
address="HelloService"
binding="basicHttpBinding"
contract="HelloService.IHelloService"></endpoint>
<endpoint …Run Code Online (Sandbox Code Playgroud) 我想在窗口服务中托管wcf.我以前做过几次没有任何问题.这次安装服务并单击启动后,我在EventViewer中收到以下错误.
Service cannot be started. System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:.../.../. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).
当我在ConsoleApplication上托管相同的服务,相同的地址时 - 好的.
有没有人有想法?