c# - example - token owin
¿Por qué Owin.Hosting.StartOptions requiere permisos de administrador? (0)
Tengo una aplicación que está haciendo uso de la funcionalidad de host de Owin.
La aplicación no necesita permisos de administrador, pero cuando utilizo el siguiente código, si no se ejecuta como administrador, recibo una excepción debido a ''acceso denegado''
var options = new StartOptions
{
ServerFactory = "Microsoft.Owin.Host.HttpListener"
};
options.Urls.Add("http://+:3579/");
using (WebApp.Start<Startup>(options)) { // .. }
Necesito proporcionar las opciones de inicio, de lo contrario obtengo el error HTTP 503 (Consulte aquí )
Aquí está la excepción cuando se ejecuta como usuario regular (no administrador)
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.StartServer(StartContext context)
at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(StartContext context)
at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start(StartOptions options)
at Microsoft.Owin.Hosting.Starter.HostingStarter.Start(StartOptions options)
at Microsoft.Owin.Hosting.WebApp.StartImplementation(IServiceProvider services, StartOptions options)
at Microsoft.Owin.Hosting.WebApp.Start(StartOptions options)
at Microsoft.Owin.Hosting.WebApp.Start[TStartup](StartOptions options)
at PlexRequests.UI.Program.Main(String[] args) in C:/Users/Jamie/Documents/GitHubVisualStudio/PlexRequests.Net/PlexRequests.UI/Program.cs:line 93
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Excepción interna: Access is Denied