diff --git a/C#-and-.NET-docs-supplement.md b/C#-and-.NET-docs-supplement.md index f51b74d..26216b0 100644 --- a/C#-and-.NET-docs-supplement.md +++ b/C#-and-.NET-docs-supplement.md @@ -40,6 +40,18 @@ You can only have 1 `default` branch, but `case _ when ...:` doesn't work. Howev On (older versions of?) VS, `Condition` is ignored if placed on a property/item. Create a new ``/``. +## MSBuild project evaluation (without build) + +[`dotnet publish --getProperty`](https://learn.microsoft.com/en-us/visualstudio/msbuild/evaluate-items-and-properties#use-command-line-options-to-output-values) + +Example: +``` +$> dotnet publish --getProperty:IsTargetingNetFramework src/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj +False +$> dotnet publish --getProperty:IsTargetingNetFramework src/BizHawk.WinForms.Controls/BizHawk.WinForms.Controls.csproj +True +``` + ## MSBuild path properties Always use `$(MSBuildProjectDirectory)` rather than `$(ProjectDir)` (note that the former doesn't include a trailing slash), because when ``ing a `.props` file, `$(ProjectDir)` is unset.