Reputation: 5674
Steps to reproduce:
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:
It works if I delete each application after step 3, and then unprovision the application type as well, before F5-deploying again in step 4. Merely deleting each application does not.
UPDATE: Rebuilding and F5-deploying seems to work intermittently, but simply F5-deploying doesn't, at least from what I could tell. I also thought for a little while that incrementing the ServiceManifest Version and ApplicationTypeVersion would help, but that didn't work consistently either. The only thing that consistently works is deleting and unprovisioning the application & application type.
I'm running VS 2015 RC as administrator, on Windows 8.1 Pro x64, and the services are .NET 4.5 just like in the tutorial.
Upvotes: 1
Views: 880
Reputation: 9050
The error message here is key: Message=Access is denied.
Usually this means one of two things:
Given that it works the first time you deploy, it's probably not #1. And given that it works when you delete and unprovision the application, I would guess your host process isn't being terminated when you F5 again. When you F5 the second time, can you check to see if your service's service host process is still running?
Upvotes: 0