2017-10-23 14 views
0

を構築し、これは問題では、プロジェクトで作成されたログこれは私のビルドステップ</p> <p><a href="https://i.stack.imgur.com/RAZPJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RAZPJ.png" alt="enter image description here"></a></p> <p>あるステップ

2017-10-23T12:46:42.8958745Z ##[section]Starting: dotnet run Tools 
2017-10-23T12:46:42.8958745Z ============================================================================== 
2017-10-23T12:46:42.8958745Z Task   : .NET Core 
2017-10-23T12:46:42.8958745Z Description : Build, test and publish using dotnet core command-line. 
2017-10-23T12:46:42.8958745Z Version  : 1.0.2 
2017-10-23T12:46:42.8958745Z Author  : Microsoft Corporation 
2017-10-23T12:46:42.8958745Z Help   : [More Information](https://go.microsoft.com/fwlink/?linkid=832194) 
2017-10-23T12:46:42.8958745Z ============================================================================== 
2017-10-23T12:46:43.3968589Z [command]"C:\Program Files\dotnet\dotnet.exe" run d:\a\1\s\Tools\Tools.csproj --configuration test 
2017-10-23T12:46:43.5008554Z Couldn't find a project to run. Ensure a project exists in d:\a\1\s, or pass the path to the project using --project. 
2017-10-23T12:46:43.5138548Z ##[error]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1 
2017-10-23T12:46:43.5138548Z ##[error]Dotnet command failed with non-zero exit code on the following projects : d:\a\1\s\Tools\Tools.csproj 
2017-10-23T12:46:43.5168542Z ##[section]Finishing: dotnet run Tools 

ですタスクは実行する必要があります。引数は--projectです。しかし、ビルド・ステップが提供するオプションを使って、どうすればいいですか?

+0

は、(ソースを取得)、ワークスペースのマッピングの設定は何ですか?あなたのプロジェクトの構造は何ですか? (例:ToolsフォルダのTools.csproj)スクリーンショットを提供します。 –

答えて

1

あなたがGitのレポでは、以下の内容で保存されたネットコアコンソールアプリケーションを持っていると仮定すると:

reporoot/ 
reporoot/Program.cs 
reporoot/temp.csproj 

ネットコアタスクに次の引数を提供し、.NETでそれを実行するために:

  • コマンド:実行
  • プロジェクト:* .csproj
  • 引数がtemp.csproj
を-p

これがサンプル出力されます。

2017-10-23T18:14:22.2924112Z ##[debug]C:\Program Files\dotnet\dotnet.exe arg: run 2017-10-23T18:14:22.2924112Z ##[debug]C:\Program Files\dotnet\dotnet.exe arg: d:\a\1\s\temp.csproj 2017-10-23T18:14:22.2924112Z ##[debug]C:\Program Files\dotnet\dotnet.exe arg: -p temp.csproj 2017-10-23T18:14:22.2934125Z ##[debug]exec tool: C:\Program Files\dotnet\dotnet.exe 2017-10-23T18:14:22.2934125Z ##[debug]arguments: 2017-10-23T18:14:22.2934125Z ##[debug] run 2017-10-23T18:14:22.2934125Z ##[debug] d:\a\1\s\temp.csproj 2017-10-23T18:14:22.2934125Z ##[debug] -p 2017-10-23T18:14:22.2934125Z ##[debug] temp.csproj 2017-10-23T18:14:22.2943933Z [command]"C:\Program Files\dotnet\dotnet.exe" run d:\a\1\s\temp.csproj -p temp.csproj 2017-10-23T18:14:36.1934899Z Hello World!

+0

は動作しません:[コマンド] "C:\ Program Files \ dotnet \ dotnet.exe" d:\ a \ 1 \ s \ Tools \ Tools.csproj -p Tools.csproj - 'MSBUILD:error MSB1009:プロジェクトファイルが存在しません。スイッチ:Tools.csproj' – Sandro

+1

あなたのプロジェクトがToolsディレクトリの下にあることに注意してください。-p引数もそれを必要とします –

+0

それでした。完璧!ありがとう! – Sandro

関連する問題

 関連する問題