dotnet核心项目不在debian工作

时间:2017-03-23 22:29:41

标签: debian .net-core

我正在尝试在debian jessie中运行一个dotnet核心webapi。该项目在Windows上正常运行,但是当我在Linux上运行dotnet还原时,我得到了

“错误MSB4019:找不到导入的项目”/usr/share/dotnet/sdk/1.0.1/Microsoft/VisualStudio/v14.0/DotNet/Microsoft.DotNet.Props。确认路径中的路径声明是正确的,并且该文件存在于磁盘上。“ 此外,如果我尝试示例helloworld应用程序,它适用于debian。

以下是我的project.json

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.1",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Mvc": "1.0.1",
    "Microsoft.AspNetCore.Routing": "1.0.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0"
  },

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

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

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

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

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

最后一件事,它实际上是在windows docker工具上运行的jessie的docker容器。

1 个答案:

答案 0 :(得分:0)

我不得不删除" projectname.xproj",错误消失但我开始得到"还原未找到错误。为了解决这个问题,我删除了我的project.json文件并创建了一个projectname.csproj文件,并在其中添加了所有依赖项。所有人都开始像魅力一样工作