【发布时间】:2015-10-03 11:23:27
【问题描述】:
重现步骤:
- 创建一个应用程序(在我的例子中,按照 OWIN+Web API 教程使用两个无状态服务,并将每个实例计数保留为 1)
- F5-deploy 启动应用程序 - 一切正常,我可以在 Service Fabric Explorer 中看到应用程序
- 在 VS 2015 (RC) 中按 Shift-F5 停止调试 - 应用程序继续在 Service Fabric Explorer 中运行
- 再次F5-deploy -- 每个无状态服务出现异常,如下:
System.Reflection.TargetInvocationException was unhandled by user code HResult=-2146232828 Message=Exception has been thrown by the target of an invocation. Source=mscorlib StackTrace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Owin.Hosting.ServerFactory.ServerFactoryAdapter.Create(IAppBuilder builder) at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(StartContext context) at Microsoft.Owin.Hosting.WebApp.Start(String url, Action`1 startup) at Infrastructure.OwinCommunicationListener.OpenAsync(CancellationToken cancellationToken) in C:\Users\Lars\Documents\Visual Studio 2015\Projects\WebApiSF\Infrastructure\OwinCommunicationListener.cs:line 47 at Microsoft.ServiceFabric.Services.StatelessServiceBase.<OpenCommunicationListenerAsync>d__8.MoveNext() InnerException: ErrorCode=5 HResult=-2147467259 Message=Access is denied NativeErrorCode=5 Source=System StackTrace: at System.Net.HttpListener.AddAllPrefixes() at System.Net.HttpListener.Start() at Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(HttpListener listener, Func`2 appFunc, IList`1 addresses, IDictionary`2 capabilities, Func`2 loggerFactory) at Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(Func`2 app, IDictionary`2 properties) InnerException:
如果我在第 3 步之后删除每个应用程序,然后在第 4 步再次 F5 部署之前取消配置应用程序类型,它会起作用。仅仅删除每个应用程序不会。
更新:重建和 F5 部署似乎间歇性地工作,但只是 F5 部署没有,至少据我所知。我还想了一会儿,增加 ServiceManifest 版本和 ApplicationTypeVersion 会有所帮助,但这也不能始终如一地工作。唯一始终有效的是删除和取消配置应用程序和应用程序类型。
我在 Windows 8.1 Pro x64 上以管理员身份运行 VS 2015 RC,服务是 .NET 4.5,就像教程中一样。
【问题讨论】:
-
您在这里找到解决方案了吗?我似乎遇到了非常相似的问题
-
我没有看到这个问题再次出现;目前我没有在 SF 中构建任何 Web API 服务。
-
感谢您的回复。我设法将我遇到的问题缩小到我的病毒防护上。我有两台电脑都打开了这个解决方案,一台一直很好,而另一台一直在播放。关闭正在播放的病毒防护似乎让事情变得更好。
标签: azure azure-service-fabric