我在 VS2013 :
中遇到了这样的问题每当我尝试调试WCF库项目时,我在启动时都会收到错误:
WcfSvcHost.exe 中发生了未处理的“ System.AccessViolationException ”异常。
即使从模板调试新的WCF项目也是如此 - 不起作用。 事件查看器:
.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()`
事件查看器中的应用程序错误:
应用程序导致错误:WcfSvcHost.exe,ver:12.0.21005.1,timestamp:0x524fc58b
模块导致错误:KERNELBASE.dll,版本:6.3.9600.17278,时间戳:0x53eebf2e
例外代码:0xe0434352
导致进程ID:0x8d8
错误应用程序路径: C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ Common7 \ IDE \ WcfSvcHost.exe
错误模块路径: C:\ Windows \ system32 \ KERNELBASE.dll
Windows:8.1 Pro x64 ,所有可用的更新在 VS 2013专业版12.0.31101.00更新4
我会非常感激任何帮助,用这个把头撞在墙上......
答案 0 :(得分:4)
在Windows 8上使用HttpListener
时与WebApi\SignalR Owin
存在同样的问题。
在我的代码中我正在打电话:
WebApp.Start<Startup>(url);
在System.Net.UnsafeNclNativeMethods.SetFileCompletionNotificationModes
中引发访问冲突。
原来,&#34;一些&#34;第三方程序与Microsoft的ifs winsock lsps不兼容。对我来说,这是Lavasoft&#34; Web Companion&#34;。 (哪个卸载修复了问题)
请参阅 Handshake exception occurring when connecting to SQL Server Azure with .NET 4.5
SetFileCompletionNotificationModes seems to not work properly
https://support.microsoft.com/en-us/kb/2568167
希望这有帮助。