小编der*_*f26的帖子

ASP.NET Core 1.1在本地运行良好,但在发布到Azure时说"启动应用程序时出错".

我一直在开发一个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)

.net c# model-view-controller azure asp.net-core

50
推荐指数
4
解决办法
3万
查看次数

Swift PromiseKit: Equivalent to when() which executes sequentially?

I'm using PromiseKit with Swift, which has been very handy so far. One of the functions they provide is when(), which allows you to have an array of any number of promises and execute something only once ALL of them have completed.

但是,数组中的承诺是并行执行的。我还没有找到任何允许我按顺序执行它们的函数。我尝试编写自己的递归函数,但它似乎没有按照它们在数组中的顺序执行承诺,而且我偶尔会遇到“承诺已释放”错误。请帮忙!

static func executeSequentially(promises: [Promise<Void>]) -> Promise<Void> {
    return Promise<Void> { fulfil, reject in
        var mutablePromises = promises
        if mutablePromises.count > 0 {
            mutablePromises.first!
                .then { _ -> Promise<Void> in
                    print("DEBUG: \(mutablePromises.count) promises in promise array.")
                    mutablePromises.remove(at: …
Run Code Online (Sandbox Code Playgroud)

ios swift promisekit

6
推荐指数
1
解决办法
984
查看次数

标签 统计

.net ×1

asp.net-core ×1

azure ×1

c# ×1

ios ×1

model-view-controller ×1

promisekit ×1

swift ×1