我一直在开发一个ASP.NET Core Web应用程序,主要基于Visual Studio 2017 RC2中提供的MVC模板.它在本地调试模式下运行良好,但是当我尝试将其发布到Azure托管的Web应用程序时,我收到此错误:
启动应用程序时发生错误.
.NET Core X86 v4.1.1.0 | Microsoft.AspNetCore.Hosting版本1.1.0-rtm-22752 | Microsoft Windows 6.2.9200
我已经尝试stdoutLogEnabled="true"在web.config文件中设置,但似乎没有效果,错误是一样的.
更新:
在一些帮助下,我设法检索日志,它说:
Application startup exception: System.TypeLoadException: Could not load type 'System.IO.File' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
at Microsoft.Extensions.DependencyModel.FileWrapper.OpenRead(String path)
at Microsoft.Extensions.DependencyModel.DependencyContextLoader.LoadEntryAssemblyContext(IDependencyContextReader reader)
at Microsoft.Extensions.DependencyModel.DependencyContextLoader.Load(Assembly assembly)
at Microsoft.Extensions.DependencyModel.DependencyContext.Load(Assembly assembly)
at Microsoft.AspNetCore.Mvc.Internal.DefaultAssemblyPartDiscoveryProvider.DiscoverAssemblyParts(String entryPointAssemblyName)
at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.GetApplicationPartManager(IServiceCollection services)
at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcCore(IServiceCollection services)
at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddMvc(IServiceCollection services)
at Bla.Api.Startup.ConfigureServices(IServiceCollection services) in C:\Users\user\Source\Workspaces\Bla\Bla.Api\src\Bla.Api\Startup.cs:line 73
--- End of stack trace from previous location where exception was thrown --- …Run Code Online (Sandbox Code Playgroud) 我试图在Windows Server 2008 R2上发布我的ASP.NET核心应用程序,但是我收到此错误:"启动应用程序时出错."
没有更多的描述!
我能做什么?
asp.net asp.net-core-mvc asp.net-core visual-studio-2017 asp.net-core-1.1