问题描述
我在 VS2013 有这样的问题:
每当我尝试调试WCF库项目,我得到在启动时出现错误:
Whenever I try to debug a WCF Library project I get an error on startup:
类型的未处理的异常' System.AccessViolationException '发生在 WcfSvcHost.exe 。
试图从调试模板的新的WCF项目,即使这是相同的 - 不工作。
事件查看器:
It's the same even when trying debugging a fresh WCF project from template - does not work.Event viewer:
的 .NET运行时异常的
应用程序: WcfSvcHost.exe
版本:v4.0.30319
例外:System.AccessViolationException
堆栈:
in System.Net.UnsafeNclNativeMethods.SetFileCompletionNotificationModes(CriticalHandle handle, FileCompletionNotificationModes modes)
in System.Net.HttpListener.CreateRequestQueueHandle()
in System.Net.HttpListener.Start()
in System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
in System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
in System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
in System.ServiceModel.Channels.HttpChannelListener`1.OnOpen(TimeSpan timeout)
in System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
in System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
in System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
in System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
in System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
in Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info)
in Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(System.String)
in Microsoft.Tools.SvcHost.MainForm.theBackgroundWorker_DoWork(System.Object, System.ComponentModel.DoWorkEventArgs)
in System.ComponentModel.BackgroundWorker.WorkerThreadStart(System.Object)
in System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr, System.Object[], System.Object, System.Object[] ByRef)
in System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessageSink)
in System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
in System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
in System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
in System.Threading.ThreadPoolWorkQueue.Dispatch()`
$ b在事件查看器$ b
应用程序错误:
Application error in event viewer:
应用程序引起的错误:WcfSvcHost.exe,版本:12.0.21005.1,时间戳:0x524fc58b
模块造成错误:KERNELBASE.dll,版本:6.3.9600.17278,时间戳:0x53eebf2e
异常代码:0xe0434352
上导致进程ID:0x8d8
错误应用程序路径: C:\Program文件(x86)\Microsoft的Visual Studio 12.0\Common7\IDE\WcfSvcHost.exe
错误模块路径: C:\Windows\system32\KERNELBASE.dll
Windows系统:8.1专业版64 ,所有可用在更新
VS 2013专业版12.0.31101.00更新4
我将任何帮助非常感激,敲我的头靠在这个墙上..
I will be very grateful for any help, banging my head against the wall with this..
推荐答案
有同样的问题与的HttpListener
在使用 WebApi\SignalR Owin
在Windows 8上。
Had the same issue with HttpListener
while using WebApi\SignalR Owin
on Windows 8.
在我的代码我打电话:
WebApp.Start<启动>(URL);
抛出的访问冲突 System.Net.UnsafeNclNativeMethods.SetFileCompletionNotificationModes
。
In my code I was Calling: WebApp.Start<Startup>(url);
Throws an access violation in System.Net.UnsafeNclNativeMethods.SetFileCompletionNotificationModes
.
原来,一些第三方程序不符合微软的IFS的Winsock LSP的兼容。对我来说,这是Lavasoft的网络伴侣。 (这卸载解决了该问题)
Turns out that "some" third party programs are not compatible with Microsoft's ifs winsock lsps. For me it was Lavasoft's "Web Companion". (Which uninstalled fixed the issue)
请参阅
的
希望这有助于。
这篇关于在每一个WCF项目VS2013 WcfSvcHost.exe访问冲突异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!