ASP.NET Core构建在不同的平台上

时间:2016-11-08 14:47:05

标签: asp.net asp.net-core

我创建了一个简单的ASP.NET核心应用程序,我想在Windows 10上为Windows 10和CentOS 7构建它。所以我在project.json文件中有这个:

"runtimes": {
    "win10-x64": { },
    "centos.7-x64": { },
    "win81-x64":  { }
  },

没有“win81-x64”我收到了一个错误:

  

找不到与其中一个目标运行时兼容的框架'.NETCoreApp,Version = v1.0'的运行时目标:'win81-x64,win8-x64,win7-x64'

dotnet build命令后,我看到了:

  

将编译Project ListService(.NETCoreApp,Version = v1.0),因为缺少预期的输出编译.NETCoreApp的ListService,版本= v1.0

     

编译成功。       0警告       0错误

     

时间00:00:14.3853704

命令dotnet --info显示:

  

产品信息:    版本:1.0.0-preview2-003131    提交SHA-1哈希:635cf40e58

     

运行时环境:    操作系统名称:Windows    操作系统版本:6.3.9600    操作系统平台:Windows    RID:win81-x64

我错过了什么吗? dotnet publish -r foo-version也没有帮助。

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.1"
    },
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.1",
    "Microsoft.AspNetCore.Routing": "1.0.1",
    "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"
  },

  "runtimes": {
    "win10-x64": { },
    "centos.7-x64": { },
    "win81-x64":  { }
  },

  "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%" ]
  }
}

1 个答案:

答案 0 :(得分:2)

好的,现在它有效。 我做的是:

  1. 我从public int getMark (String name) { Node p = head; while ((p != null) && !(p.getName().equals(name)){ p = p.getNext(); } if (p == null){ return - 1; } else { return p.getMark(); } } 文件

  2. 中删除了public int getMark(String name){ Node p = head; if(head == null) { return -1; break; } while(p != null) { if(p.getName().equals(name) { return p.getMark(); } else { return -1; } p = p.getNext(); } }
  3. 我在项目文件夹

  4. 的cmd中运行了命令CREATE OR REPLACE PROCEDURE INTEGRATION(tableName varchar2) IS BEGIN MERGE INTO tableName alert USING ...

    现在我看到了

    enter image description here