「[[マイクロソフト系技術情報 Wiki>http://techinfoofmicrosofttech.osscons.jp/]]」は、「[[Open棟梁Project>https://github.com/OpenTouryoProject/]]」,「[[OSSコンソーシアム .NET開発基盤部会>https://www.osscons.jp/dotNetDevelopmentInfrastructure/]]」によって運営されています。

-[[戻る>MSBuild]]

* 目次 [#kb96d803]
#contents

*概要 [#x44f2c16]
Linux上の.NET Core環境でdotnetコマンドのビルドで~
条件付きコンパイルシンボル(DefineConstants)に設定した値が効かず、#if-#endifが適切に動作しない。

*詳細 [#m6d5dcea]
以下のConditionがLinux環境と異なるっぽい。単純にConditionを削除したら動作した。
-以下のConditionがLinux環境と異なるっぽい。
 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

-単純にConditionを削除したら動作した。
 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
   <DefineConstants>TRACE;NETCORE</DefineConstants>
 </PropertyGroup>

>↓ ↓ ↓
 <PropertyGroup>
   <DefineConstants>TRACE;NETCORE</DefineConstants>
 </PropertyGroup>

*参考 [#b0cb71d4]
-DefineConstants should be considered for CoreCompile incrementality · Issue #3350 · Microsoft/msbuild~
https://github.com/Microsoft/msbuild/issues/3350
-c# - How to use custom preprocessor directives in .Net Core - Stack Overflow~
https://stackoverflow.com/questions/43743808/how-to-use-custom-preprocessor-directives-in-net-core

----
Tags: [[:テスト]], [[:デバッグ]], [[:デプロイ]], [[:.NET開発]], [[:.NET Core]]



トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS