简体   繁体   English

WCF访问被拒绝异常

[英]WCF Access is denied Exception

An attempt to run WCF Service results in the following below. 尝试运行WCF服务导致以下结果。 I have tried the netsh related suggestions on the page referenced http://msdn.microsoft.com/en-us/library/ms733768.aspx and have not gotten anything to work. 我在http://msdn.microsoft.com/en-us/library/ms733768.aspx页面上尝试了与netsh相关的建议,并且没有任何工作。 Please help with information on how I can resolve this please. 请帮忙了解我如何解决这个问题。

Thanks in advance. 提前致谢。

{"HTTP could not register URL http://+:8439/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details)."}

   at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
   at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
   at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
   at System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open()
   at TestThreadSync.Form1.ListenOnChannel() in C:\Users\MyAccount\Desktop\TestService\Form1.cs:line 51
   at TestThreadSync.Form1.Form1_Load(Object sender, EventArgs e) in C:\Users\MyAccount\Desktop\TestService\Form1.cs:line 32
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
   at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Control.set_Visible(Boolean value)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at TestThreadSync.Program.Main() in C:\Users\MyAccount\Desktop\TestService\Program.cs:line 18

Two options (either of two can be used) 两个选项(两个中的任何一个都可以使用)

1.Use netsh utility to provide access to the port 1.使用netsh实用程序提供对端口的访问

netsh http add urlacl url=http://+:8439/ user=DOMAIN\\UserName netsh http add urlacl url = http:// +:8439 / user = DOMAIN \\ UserName

http://blogs.msdn.com/b/amitlale/archive/2007/01/29/addressaccessdeniedexception-cause-and-solution.aspx http://blogs.msdn.com/b/amitlale/archive/2007/01/29/addressaccessdeniedexception-cause-and-solution.aspx

2.Admin privileges are required 2.Admin权限是必需的

Run as Administrator (either Visual studio, or the application itself) 以管理员身份运行(Visual Studio或应用程序本身)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM