指定的 deps.json '$$$' 不存在 [英] The specified deps.json '$$$' does not exist

本文介绍了指定的 deps.json '$$$' 不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 .NET Core 的新手,我有一个 .NET Core WebAPI 项目 MyWebApp,
另外,我有使用 EntityFrameworkCore 的 .Net Core 类库项目 MyLib

I am rather new to the .NET Core, and I got a .NET Core WebAPI project MyWebApp,
also, i have .Net Core Class Library project MyLib using EntityFrameworkCore

当我尝试使用 Add-Migration 时,出现错误
指定的 deps.json [...MyWebAppinDebug etcoreapp1.1MyWebApp.deps.json] 不存在

When i try to use Add-Migration, i get the error
The specified deps.json [...MyWebAppinDebug etcoreapp1.1MyWebApp.deps.json] does not exist

检查文件夹,我注意到我在 [...MyWebAppinDebug etcoreapp1.1win10-x64MyWebApp.deps.json] 中有一个文件

Inspecting the folder, I noticed I have this a file in [...MyWebAppinDebug etcoreapp1.1win10-x64MyWebApp.deps.json]

但我真的不知道我应该怎么做才能解决这个问题.

but i really can't figure what i am supposed to do to resolve this.

myWebApi project.json:

myWebApi project.json:

{
  "dependencies": {
  "ShopManager": "1.0.0-*",
  "Microsoft.AspNetCore.StaticFiles": "1.1.0",
  "Microsoft.AspNetCore.Mvc": "1.1.0",
  "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
  "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
  "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
  "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
  "Microsoft.Extensions.Configuration.Json": "1.1.0",
  "Microsoft.Extensions.Logging": "1.1.0",
  "Microsoft.Extensions.Logging.Console": "1.1.0",
  "Microsoft.Extensions.Logging.Debug": "1.1.0",
  "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
  "Microsoft.NETCore.App": "1.1.0"
  },

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },
  "runtimes": {
    "win10-x64": ""
  },
  "frameworks": {
    "netcoreapp1.1": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "Areas/**/Views",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

推荐答案

runtimesproject.json 部分看起来很可疑.只要您只为一个运行时构建 - 就没有必要使用它.

runtimes section in project.json looks suspicious. As soon as you build for one runtime only - there is no need to use it.

删除它并将依赖项从 "Microsoft.NETCore.App":"1.1.0" 重写为 "Microsoft.NETCore.App": { "type": "platform","version": "1.1.0" }.

Remove it and rewrite dependency from "Microsoft.NETCore.App":"1.1.0" to "Microsoft.NETCore.App": { "type": "platform", "version": "1.1.0" }.

这会将您的应用部署模型从自包含"(即使没有框架也可以在特定平台上运行)更改为依赖于框架"(可以在安装了框架的任何平台上运行).详细信息在这里.

This will change your app deployment model from "self-contained" (can run on specific platform even without framework) to "framework-dependent" (may run on any platform with framework installed). Details are here.

这篇关于指定的 deps.json '$$$' 不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆