2017-02-23 10 views
0

私は自己完結型の.NetCore Appを構築しようとしています。単純なデフォルトのhello worldです。問題を解決する自己完結型.NetCore App

私は回答のためのグーグルでアプリを作成する方法については、Scott Hanselman'sの例に従っています。

あなたは私はタイプ行をコメントアウトし、各プラットフォーム用のランタイムを追加している見ることができるように私は私のproject.json

{ 
    "version": "1.0.0-*", 
    "buildOptions": { 
    "debugType": "portable", 
    "emitEntryPoint": true 
    }, 
    "dependencies": {}, 
    "frameworks": { 
    "netcoreapp1.1": { 
     "dependencies": { 
     "Microsoft.NETCore.App": { 
      //"type": "platform", 
      "version": "1.1.0" 
     } 
     }, 
     "imports": "dnxcore50", 
     "runtimes": { 
     "win10-x64": {}, 
     "osx.10.10-x64": {}, 
     "ubuntu.14.04-x64": {} 
     } 
    } 
    } 
} 

にこのコードを持っています。

しかし、私はこのエラーを取得しておいてください。

Can not find runtime target for framework '.NETCoreApp,Version=v1.1' compatible with one of the targe 
t runtimes: 'osx.10.10-x64'. Possible causes: 
1. The project has not been restored or restore failed - run `dotnet restore` 
2. The project does not list one of 'osx.10.10-x64' in the 'runtimes' section. 
3. You may be trying to publish a library, which is not supported. Use `dotnet pack` to distribute li 
braries. 

は、今私は、Mac上でこれを実行していますが、同じエラーがUbuntuの上で起こるが、その後のubuntuにそれを関連するエラーを報告します。

マイDOTNETのバージョンは、私は少しこだわっています= 1.0.0-preview2-1-003177

で、すべてのものは、それが動作するはずですし、それはおそらく私が見下ろす午前明白なことであるという事実を指しているようです。

何か助けていただければ幸いです。私はあなたがあなたのJSONの構造を変える必要があると思う

答えて

1

{ 
    "version": "1.0.0-*", 
    "buildOptions": { 
     "debugType": "portable", 
     "emitEntryPoint": true 
    }, 
    "dependencies": {}, 
    "frameworks": { 
     "netcoreapp1.1": { 
      "dependencies": { 
       "Microsoft.NETCore.App": { 
        "version": "1.1.0" 
       } 
      } 
     } 
    }, 
    "runtimes": { 
     "win10-x64": {}, 
     "osx.10.10-x64": {}, 
     "ubuntu.14.04-x64": {} 
    } 
} 

大きな違いはruntimesセクションが内frameworkセクションではないということです。

project.jsonを変更した後に必ずdotnet restore --no-cacheを実行してください。あなたは自己のより多くの情報を見つけることができ

このpageにして:-)トリックをした素晴らしいこの優れたanswer

+0

で展開(SCD)を含有していました –

関連する問題