An MSBuild SDK for pack-only projects.
- A project written in SDK-style. This includes any project for .NET Core(or newer) or .NET 5(or newer).
- Locate the project file(for example,
Project.csproj
,Project.fsproj
). - Open the project file in an editor.
- Locate the project's root
<Project>
element. - Edit the
Sdk
attribute's value toBelp.SDK.PackOnly/<VERSION>
. For example,Sdk="Belp.SDK.PackOnly/1.0.0"
.
By default, the target framework is set to .NET Standard 2.0. This can be overriden by defining <TargetFramework>
under a <PropertyGroup>
.
- Locate the project file(for example,
Project.csproj
,Project.fsproj
). - Open the project file in an editor.
- Add
<DisableDefaultBuild>false</DisableDefaultBuild>
to a<PropertyGroup>
.
- Install the .NET 7.0 SDK version 7.0.100 or newer.
- Open
Belp.SDK.PackOnly.sln
. - Open the Solution Explorer.
- Right click on the project
Belp.SDK.PackOnly
in the Solution Explorer. - Click on
Pack
.
- Open a terminal in the repository root.
- Run
dotnet pack
By default, the output is located in src/Belp.SDK.PackOnly/Belp.SDK.PackOnly/bin/Release/
.