In my C# and .net core program, I want to dynamically select dependency by using properties in the .csproj file. I learned from online that I can supply those properties while using the msbuild command. However, I am using dotnet. How then can I supply those flags?
I can see the confusion arises due to a misunderstanding of the relationship of msbuild and dotnet. dotnet is a wrapper of tools such as nuget and msbuild. As per the doc,
the dotnet build command accepts MSBuild options, such as /p for setting properties or /l to define a logger.
you can supply msbuild property like so:
dotnet build /p:property0=val0;property1=val1
Be careful though, if you are using this on linux or mac, when supplying multiple properties using ";", you should quote the entire /p flag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With