首页 > 解决方案 > System.Net.NetworkInformation.NetworkInformationException:系统找不到指定的文件

问题描述

我的网站在本地工作。但是,当我在 azure 上启动它时,出现如下错误。

我使用了图形 api 和 OwinStartup。

使用微软.Owin;使用欧文;

[程序集:OwinStartup(typeof(graph_tutorial.Startup))]

namespace graph_tutorial { public partial class Startup { public void Configuration(IAppBuilder app) { ConfigureAuth(app); } } }

我该如何解决?

请帮帮我。

The system cannot find the file specified
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.NetworkInformation.NetworkInformationException: The system cannot find the file specified

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NetworkInformationException (0x2): The system cannot find the file specified]
   System.Net.NetworkInformation.SystemIPGlobalProperties.GetFixedInfo() +6885092
   System.Net.NetworkInformation.SystemIPGlobalProperties.get_FixedInfo() +94
   System.Net.NetworkInformation.SystemIPGlobalProperties.get_DomainName() +131
   System.Net.CookieContainer..ctor() +102
   System.Net.Http.HttpClientHandler..ctor() +248
   System.Net.Http.WebRequestHandler..ctor() +18
   Microsoft.Owin.Security.OpenIdConnect.OpenIdConnectAuthenticationMiddleware.ResolveHttpMessageHandler(OpenIdConnectAuthenticationOptions options) +37
   Microsoft.Owin.Security.OpenIdConnect.OpenIdConnectAuthenticationMiddleware..ctor(OwinMiddleware next, IAppBuilder app, OpenIdConnectAuthenticationOptions options) +547
   lambda_method(Closure , OwinMiddleware , IAppBuilder , OpenIdConnectAuthenticationOptions ) +55

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +168
   System.Delegate.DynamicInvokeImpl(Object[] args) +124
   Microsoft.Owin.Builder.AppBuilder.BuildInternal(Type signature) +222
   Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action`1 startup) +465
   Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action`1 startup) +40
   Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +70
   System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +119
   Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +91
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +552
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +181
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +228
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +314

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10080656
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +263

标签: asp.netasp.net-mvc-5microsoft-graph-apiapp-startup

解决方案


推荐阅读