secretbase.log

.NET/C#/Pythonなど

MSBuild で Platform='BNB' とエラーが出る件の解決策がようやくわかった

コマンドラインから、MSBuild を起動すると という奇妙なエラーが出て悩まされて困ったけど解決策を発見したのでメモ。狭い範囲の誰得なエントリ。

エラーメッセージ

下記のようなエラーが出る。ポイントは、 Platform='BNB' のメッセージ。

  c:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(483,9): error : The OutputPath property is not set for project 'sample.
csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  Pl
atform='BNB'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configur
ation or Platform that doesn't exist for this project.

原因

システムの環境変数に、 PLATFORM が BNB という値が設定されているから。設定した覚えはもちろん無い。

が、設定されているよksg
f:id:cointoss1973:20120914211437p:plain

解決方法

set PLATFORM= 

とかやって空にしてから、MSBuild実行。MSBuild実行するバッチファイルの中で設定しておくといいかも。

http://www.nichesoftware.co.nz/blog/2011-05/496/invalid-build-configuration-debugbnb

たぶん この罠は、 HP ProBook だけなのかもしれないなぁ。。

環境

Windows コマンドプロンプト ポケットリファレンス

Windows コマンドプロンプト ポケットリファレンス