Azure Win32Exception:系统找不到指定的文件

Azure Win32Exception: The system cannot find the file specified

我有一个 web 应用程序 (ASP.NET 5 EF 7) 分为几个项目,其中一个用于身份模型,一个用于其他应用程序数据模型(均作为 class 库)。因此,在 azure 门户网站中,我创建了 2 个服务器(每个服务器都有 1 db),一个用于应用程序数据,一个用于身份数据。

当我尝试注册新用户时出现以下错误:

detailed error message

门户中的数据连接配置正常。

在主项目中我有一个 appsetting.json 文件

  "Data": {
    "DefaultIdentityConnection": {
      "ConnectionString": "Server=(localdb)\mssqllocaldb;Database=identityDb;Trusted_Connection=True;MultipleActiveResultSets=true"
    },
    "DefaultAppDataConnection": {
      "ConnectionString": "Server=(localdb)\mssqllocaldb;Database=appDataDb;Trusted_Connection=True;MultipleActiveResultSets=true"
    }
}

并且在每个 class 库项目中(1 用于身份,1 个用于应用程序数据)我有另一个 appsettings.json 文件具有相同的 connection-strings.

StartUp ConfigureServices 如下所示: StartUp ConfigureServices 看起来像这样:

services.AddEntityFramework()
    .AddSqlServer()
    .AddDbContext < IdentityContext > (options =>
        options.UseSqlServer(Configuration["Data:DefaultIdentityConnection:ConnectionString"]))
    .AddDbContext < AppDataContext > (options =>
        options.UseSqlServer(Configuration["Data:DefaultAppDataConnection:ConnectionString"]));

services.AddIdentity < ApplicationUser, IdentityRole > (
        config => {
            ....
        })
    .AddEntityFrameworkStores < IdentityContext > ()
    .AddDefaultTokenProviders();

在本地机器上一切正常。

我在这里错过了什么?

这显然是我的错,因为我在另外 2 个 appsettings.json 文件中定义了相同的连接字符串(1 个用于身份项目,1 个用于应用程序数据项目)并且每个都被引用为配置文件在它的父项目中(而不是从 Startup 注入 Configuration 对象,我为每个项目创建了 1 个——这是一个坏主意),我猜这很混乱。