Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Identity Server 3:未找到方法:';System.String System.String.Format(System.ifformatprovider、System.String、System.Object)和#x27;_C#_Asp.net_.net 4.5_Identityserver3_Windows Server 2012 R2 - Fatal编程技术网

C# Identity Server 3:未找到方法:';System.String System.String.Format(System.ifformatprovider、System.String、System.Object)和#x27;

C# Identity Server 3:未找到方法:';System.String System.String.Format(System.ifformatprovider、System.String、System.Object)和#x27;,c#,asp.net,.net-4.5,identityserver3,windows-server-2012-r2,C#,Asp.net,.net 4.5,Identityserver3,Windows Server 2012 R2,这是我第三次安装IdentityServer,我从未遇到过这种情况。该应用程序在我们的开发环境中运行良好,该环境是Server2012 R2,安装了.NET4.6 PROD服务器是server 2012 R2,仅安装了.NET 4.5.2。安装4.6不是一个选项,但愿如此。服务器被很好地锁定了 这是堆栈跟踪,我尝试了挖掘代码,但在Core\Configuration\Hosting\WebApiConfig.cs:38中遇到了死胡同。我将目标框架强制设置为4.5.1,只是为了看看它是否有所不同

这是我第三次安装IdentityServer,我从未遇到过这种情况。该应用程序在我们的开发环境中运行良好,该环境是Server2012 R2,安装了.NET4.6

PROD服务器是server 2012 R2,仅安装了.NET 4.5.2。安装4.6不是一个选项,但愿如此。服务器被很好地锁定了

这是堆栈跟踪,我尝试了挖掘代码,但在Core\Configuration\Hosting\WebApiConfig.cs:38中遇到了死胡同。我将目标框架强制设置为4.5.1,只是为了看看它是否有所不同

我已经通过访问.well-known/openid配置对其进行了测试

[MissingMethodException:找不到方法:'System.String System.String.Format(System.IFormatProvider、System.String、, System.Object')。]
System.Net.Http.Headers.MediaTypeHeaderValue.CheckMediaTypeFormat(字符串 mediaType,字符串参数Name)+0
System.Net.Http.Headers.MediaTypeHeaderValue..ctor(字符串mediaType) +33 System.Net.Http.Formatting.MediaTypeConstants..cctor()+45

[TypeInitializationException:的类型初始值设定项 “System.Net.Http.Formatting.MediaTypeConstants”引发异常。]
System.Net.Http.Formatting.JsonMediaTypeFormatter..ctor()+99
System.Net.Http.Formatting.MediaTypeFormatterCollection.CreateDefaultFormatters() +49 System.Web.Http.HttpConfiguration..ctor(HttpRouteCollection路由)+255
IdentityServer3.Core.Configuration.Hosting.WebApiConfig.Configure(IdentityServerOptions 选项,ILifetimeScope容器)中的 Core\Configuration\Hosting\WebApiConfig.cs:38 Owin.UseIdentityServer扩展.UseIdentityServer(IAppBuilder应用程序, Core\Configuration\AppBuilderExtensions\UseIdentityServerExtension.cs:109中的IdentityServerOptions选项) MapExtensions.Map(IAppBuilder应用程序,路径字符串路径匹配,操作1 配置)+240 Owin.MapExtensions.Map(IAppBuilder应用程序,字符串 路径匹配,操作'1配置)+181
中的WEC.WebApp.IdSrv.Startup.Configuration(IAppBuilder应用程序) C:\Projects\WEC.WebApp.Authentication\DEV\WEC.IdentityServer\WEC.WebApp.IdSrv\Startup.cs:44

[TargetNotificationException:的目标已引发异常 调用。]System.RuntimeMethodHandle.InvokeMethod(对象 目标、对象[]参数、签名符号、布尔构造函数)+0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(对象obj, 对象[]参数,对象[]参数)+76
System.Reflection.RuntimeMethodInfo.Invoke(对象obj,BindingFlags invokeAttr,绑定器绑定器,对象[]参数,CultureInfo区域性) +211 System.Reflection.MethodBase.Invoke(对象obj,对象[]参数)+35
Owin.Loader.c_uuudisplayClass1.b_uuu0(IAppBuilder 建筑商)+341
Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(操作1 启动)+1043
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint()文件 +119系统。线程。LazyInitializer。EnsureInitializedCore(T&target,Boolean&initialized,Object&syncLock,Func`1 valueFactory) +241 Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication 上下文)+129
System.Web.HttpApplication.registereventsubscriptionswithis(IntPtr appContext、HttpContext、MethodInfo[]处理程序)+571
System.Web.HttpApplication.InitSpecial(HttpApplicationState, MethodInfo[]处理程序,IntPtr appContext,HttpContext)+322
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext,HttpContext)+402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)+452

[HttpException(0x80004005):目标已引发异常 指一次调用。]
System.Web.HttpRuntime.FirstRequestInit(HttpContext上下文)+646
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext上下文) +159 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext)+778


你知道问题出在哪里了吗?我们在Azure中的Web应用程序上也面临类似的问题。