CRUD dotnet commands for MSBuild properties
See original GitHub issueWould be nice if dotnet had commands to add/read/change/remove properties in an MSBuild file.
Example:
dotnet prop set VersionSuffix beta
Would update project to include, or would alter its value if it already exists
<PropertyGroup>
<VersionSuffix>beta</VersionSuffix>
</PropertyGroup>
Example 2: Reading properties values.
$ dotnet prop get OutputType
Exe
Scenarios:
- Tools like dotnet-user-secrets may want to read or manipulate a property in the csproj. Example feature on this tool: https://github.com/aspnet/DotNetTools/issues/166
- Good for automation scripts such as auto-updating versions. Ex:
dotnet prop set VersionPrefix 2.0.0
- Support reading multiple properties at once. This would simplify MSBuild interaction for CLI tools such as ‘dotnet-ef’ that need multiple properties from a project.
cc @blackdwarf
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:8 (6 by maintainers)
Top Results From Across the Web
dotnet build command - .NET CLI
The dotnet build command builds the project and its dependencies into a set of binaries. The binaries include the project's code in Intermediate ......
Read more >NET + MSBuild - C# Project File (.csproj) in a Nutshell
A .NET project file specifies the components in the project and how it is built using MSBuild XML code made up of four...
Read more >dotnet msbuild command - .NET CLI
The dotnet msbuild command allows access to a fully functional MSBuild. The command has the exact same capabilities as the existing MSBuild ......
Read more >NET 7.0 + Dapper + MS SQL Server - CRUD API Tutorial in ...
In this tutorial we'll show how to build a .NET 7.0 (ASP.NET Core) API with Dapper and MS SQL Server that supports CRUD...
Read more >MSBuild reference for .NET SDK projects
Reference for the MSBuild properties and items that are understood by the .NET SDK.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could we start with “get” and do “set” later?
Almost all CLI tools need to read properties like OutputPath, AssemblyName, TargetFramework, etc. (dotnet-watch, dotnet-ef, dotnet-xunit to name a few)
Only a few of them need to edit a csproj. And there are simple solutions for this. For example, a CLI tool might simply print a message that says “Please add
<xml here>
to your csproj”.Any update on this?