Install
openclaw skills install msbuildProvides a prioritized set of 80 essential MSBuild CLI commands for restoring, building, testing, publishing, packaging, diagnosing, and CI-hardening .NET/AS...
openclaw skills install msbuildThis skill provides a practical, prioritized set of the 80 most useful command templates for working with .NET / ASP.NET projects on the command line using MSBuild (via dotnet msbuild or msbuild). It mirrors a realistic day-to-day workflow: restore → build → test → publish/pack → diagnose → CI hardening.
A typical ASP.NET CLI workflow:
Ranking reflects frequency + impact in that flow.
dotnet msbuildmsbuild/t:<Target>/p:Name=Value/v:<level>, /bl[:file], /fl, /pp/m[:n]dotnet test is included because it is the practical test CLI (it invokes MSBuild under the hood).Replace
MySolution.sln/src/MyWeb/MyWeb.csproj/tests/...as needed.
dotnet msbuild MySolution.sln /t:Restore
dotnet msbuild MySolution.sln /t:Build /p:Configuration=Debug
dotnet msbuild MySolution.sln /t:Build /p:Configuration=Release
dotnet msbuild MySolution.sln /t:Clean /p:Configuration=Debug
dotnet msbuild MySolution.sln /t:Rebuild /p:Configuration=Release
dotnet msbuild MySolution.sln /restore /t:Build /p:Configuration=Debug
dotnet msbuild MySolution.sln /t:Build /p:Configuration=Release /p:Restore=false
dotnet msbuild MySolution.sln /t:Build /m /p:Configuration=Release
dotnet msbuild MySolution.sln /t:Build /nologo /v:minimal /p:Configuration=Release
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Build /p:Configuration=Debug
dotnet msbuild MySolution.sln /t:Build /p:Configuration=Release /p:Platform="Any CPU"
dotnet msbuild MySolution.sln /t:Build /p:Configuration=Release /p:TreatWarningsAsErrors=true
dotnet msbuild MySolution.sln /t:Build /p:Configuration=Release /p:Deterministic=true
dotnet msbuild MySolution.sln /t:Build /p:Configuration=Release /p:ContinuousIntegrationBuild=true
dotnet msbuild MySolution.sln /t:Build /p:Configuration=Release /p:DisableFastUpToDateCheck=true
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Build /p:Configuration=Debug /p:DefineConstants="TRACE;DEBUG;MYFLAG"
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Build /p:Configuration=Release /p:OutputPath=artifacts/bin/
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Build /p:Configuration=Release /p:BaseIntermediateOutputPath=artifacts/obj/
dotnet msbuild MySolution.sln /t:Build /p:Configuration=Debug /p:UseSharedCompilation=false
dotnet msbuild -version
dotnet test MySolution.sln -c Release
dotnet test MySolution.sln -c Release --no-build
dotnet test MySolution.sln -c Release --no-restore
dotnet test tests/MyWeb.Tests/MyWeb.Tests.csproj -c Debug
dotnet test MySolution.sln -c Release --filter "FullyQualifiedName~MyNamespace"
dotnet test MySolution.sln -c Release --filter "TestCategory=Integration"
dotnet test MySolution.sln -c Release --logger "trx"
dotnet test MySolution.sln -c Release --results-directory artifacts/testresults
dotnet test MySolution.sln -c Release --collect "XPlat Code Coverage"
dotnet test MySolution.sln -c Release -v normal
dotnet test MySolution.sln -c Release --blame
dotnet test MySolution.sln -c Release --filter "Name=MySpecificTest"
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:PublishDir=artifacts/publish/
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:RuntimeIdentifier=linux-x64
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:RuntimeIdentifier=linux-x64 /p:SelfContained=true
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:SelfContained=false
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:RuntimeIdentifier=win-x64 /p:PublishSingleFile=true
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:PublishReadyToRun=true
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:PublishTrimmed=true
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:RuntimeIdentifier=linux-x64 /p:PublishSingleFile=true /p:PublishTrimmed=true
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:EnvironmentName=Production
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:Version=1.2.3
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:TargetFramework=net8.0
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:ContinuousIntegrationBuild=true /p:Deterministic=true
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:RuntimeIdentifier=linux-x64 /p:SelfContained=true /p:PublishDir=artifacts/publish/linux-x64/
dotnet msbuild src/MyLib/MyLib.csproj /t:Pack /p:Configuration=Release
dotnet msbuild src/MyLib/MyLib.csproj /t:Pack /p:Configuration=Release /p:PackageOutputPath=artifacts/nuget/
dotnet msbuild src/MyLib/MyLib.csproj /t:Pack /p:Configuration=Release /p:Version=1.2.3
dotnet msbuild src/MyLib/MyLib.csproj /t:Build /p:Configuration=Release /p:AssemblyVersion=1.2.0.0 /p:FileVersion=1.2.3.0
dotnet msbuild src/MyLib/MyLib.csproj /t:Build /p:Configuration=Release /p:InformationalVersion=1.2.3+sha.abcdef
dotnet msbuild MySolution.sln /t:Restore /p:RestorePackagesWithLockFile=true
dotnet msbuild MySolution.sln /t:Restore /p:RestoreLockedMode=true
dotnet msbuild MySolution.sln /t:Restore /p:RestoreConfigFile=NuGet.config
dotnet msbuild MySolution.sln /t:Restore /p:RestorePackagesPath=artifacts/nuget-packages
dotnet msbuild MySolution.sln /t:Build /p:Configuration=Release /bl
dotnet msbuild MySolution.sln /t:Build /p:Configuration=Release /bl:artifacts/logs/build.binlog
dotnet msbuild MySolution.sln /t:Build /v:detailed
dotnet msbuild MySolution.sln /t:Build /v:diag
dotnet msbuild MySolution.sln /t:Build /fl /flp:logfile=artifacts/logs/build.log;verbosity=normal
dotnet msbuild MySolution.sln /t:Build /clp:Summary;PerformanceSummary
dotnet msbuild src/MyWeb/MyWeb.csproj /pp:artifacts/logs/preprocessed.xml
dotnet msbuild MySolution.sln /t:Build /graphBuild /p:Configuration=Release
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Clean /p:Configuration=Release
dotnet msbuild MySolution.sln /t:Build /m /v:minimal /clp:ShowCommandLine
dotnet msbuild MySolution.sln /t:Build /nr:false /p:Configuration=Release
dotnet msbuild MySolution.sln /t:Build /m:4 /p:Configuration=Release
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Build /p:Configuration=Release /p:MyCustomProperty=Value
dotnet msbuild MySolution.sln /t:Restore /p:RestoreSources="https://api.nuget.org/v3/index.json;https://myfeed/v3/index.json"
dotnet msbuild MySolution.sln /t:Build /p:Restore=false /p:BuildProjectReferences=true
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Build /p:BuildProjectReferences=false
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:RuntimeIdentifier=linux-x64 /p:SelfContained=true /p:UseAppHost=true
dotnet msbuild src/MyWeb/MyWeb.csproj /t:Publish /p:Configuration=Release /p:UseAppHost=false
dotnet msbuild MySolution.sln /t:Restore /p:NuGetInteractive=true
dotnet msbuild MySolution.sln /t:Build /p:MSBuildSDKsPath=/path/to/sdks
msbuild MySolution.sln /t:Build /p:Configuration=Release /m
msbuild MySolution.sln /t:Restore
msbuild src\MyWeb\MyWeb.csproj /t:Publish /p:Configuration=Release /p:PublishDir=artifacts\publish\
msbuild MySolution.sln /t:Build /p:Configuration=Release /bl:artifacts\logs\msbuild.binlog
msbuild src\MyWeb\MyWeb.csproj /pp:artifacts\logs\preprocessed.xml
When you describe a goal (e.g., “Publish linux-x64 self-contained single-file”), the skill should output:
/bl) to capture a binlog if something fails./bl and inspect with MSBuild Structured Log Viewer.