Is it possible to create the deb package as part of the standard build process? #124

Open
opened 2026-01-29 16:30:05 +00:00 by claunia · 1 comment
Owner

Originally created by @stephen-swensen on GitHub (Aug 4, 2022).

Rather than having to invoke dotnet deb from the command line, is it possible to create the deb package as part of the regular build process (i.e. right click project -> Build in Visual Studio). After poking around, I tried adding the following to my project file

  <UsingTask TaskName="Packaging.Targets.DebTask" AssemblyName="Packaging.Targets" />
  ...
  <ItemGroup>
    <PackageReference Include="Packaging.Targets" Version="0.1.220">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>
  ...
  <Target Name="CreateDebOnReleaseBuild" Condition="$(Configuration) == 'Release'" AfterTargets="Build">
    <CreateDeb />
  </Target>

But I get the following error:

error MSB4036: The "CreateDeb" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with in the project file, or in the *.tasks files located in the "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64" directory.

Originally created by @stephen-swensen on GitHub (Aug 4, 2022). Rather than having to invoke `dotnet deb` from the command line, is it possible to create the deb package as part of the regular build process (i.e. right click project -> Build in Visual Studio). After poking around, I tried adding the following to my project file ``` <UsingTask TaskName="Packaging.Targets.DebTask" AssemblyName="Packaging.Targets" /> ... <ItemGroup> <PackageReference Include="Packaging.Targets" Version="0.1.220"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> </ItemGroup> ... <Target Name="CreateDebOnReleaseBuild" Condition="$(Configuration) == 'Release'" AfterTargets="Build"> <CreateDeb /> </Target> ``` But I get the following error: > error MSB4036: The "CreateDeb" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64" directory.
Author
Owner

@nref commented on GitHub (Jul 20, 2023):

CreateDeb target is available for me after referencing Packaging.Targets

    <PackageReference Include="Packaging.Targets" Version="0.1.220" />
@nref commented on GitHub (Jul 20, 2023): `CreateDeb` target is available for me after referencing `Packaging.Targets` ```xml <PackageReference Include="Packaging.Targets" Version="0.1.220" /> ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#124