Is it possible to create a .deb package for a Visual Studio solution with multiple projects in it? #109

Open
opened 2026-01-29 16:29:47 +00:00 by claunia · 5 comments
Owner

Originally created by @d79ima on GitHub (Nov 12, 2021).

I have a solution with 5 projects. The exe project is .net core 3.1, the other projects are .net standard 2.0.

Can i use this tool to create an ubuntu.18.04-x64 .deb package which will package without having to add " ubuntu.18.04-x64 .deb" as a runtime identifier in every single one of the 5 projects? Ideally i would just add this into the exe project...

Originally created by @d79ima on GitHub (Nov 12, 2021). I have a solution with 5 projects. The exe project is .net core 3.1, the other projects are .net standard 2.0. Can i use this tool to create an ubuntu.18.04-x64 .deb package which will package without having to add " ubuntu.18.04-x64 .deb" as a runtime identifier in every single one of the 5 projects? Ideally i would just add this into the exe project...
Author
Owner

@qmfrederik commented on GitHub (Nov 12, 2021):

Yes, that should work -- that's how we use it internally. You would only need to add Packaging.Targets to your main (executable) project, and then you can run dotnet deb/rpm/zip on that project.

Is there's a specific issue you are seeing?

@qmfrederik commented on GitHub (Nov 12, 2021): Yes, that should work -- that's how we use it internally. You would only need to add Packaging.Targets to your main (executable) project, and then you can run `dotnet deb/rpm/zip` on that project. Is there's a specific issue you are seeing?
Author
Owner

@d79ima commented on GitHub (Nov 12, 2021):

if i just add
ubuntu.18.04-x64 into my .exe .csproj i get errors for the other projects.

I guess i am not familiar with how to create a Packaging.Targets file
Could you please point me at a link or a small example targets file. I just dont know what needs to go into this targets file

@d79ima commented on GitHub (Nov 12, 2021): if i just add <RuntimeIdentifiers>ubuntu.18.04-x64</RuntimeIdentifiers> into my .exe .csproj i get errors for the other projects. I guess i am not familiar with how to create a Packaging.Targets file Could you please point me at a link or a small example targets file. I just dont know what needs to go into this targets file
Author
Owner

@d79ima commented on GitHub (Nov 16, 2021):

ok figured it out. YOu have to add Packaging.Targets as a nuget package to the main application project

@d79ima commented on GitHub (Nov 16, 2021): ok figured it out. YOu have to add Packaging.Targets as a nuget package to the main application project
Author
Owner

@jb0490 commented on GitHub (Feb 3, 2022):

I have a similar problem: 1 solution with 13 projects divided among 3 folders. 2 app folders (client and server) and 1 common folder. The client folder has 5 projects: 1 UWP app project and 4 library projects. The common folder has 3 library projects. The server folder has 5 projects: 1 .net core 3.1 console app project and 4 library projects. All 11 library projects are .net standard 2.0.

I installed the tool package in the server console app project. However, I cannot create a deb package unless I add runtime identifier "linux-x64" to all the server and common projects. These 8 projects already contain a runtime identifier for "win-x86". Inserting an additional "linux-x86" runtime identifier to each of the 8 projects allows me to create a deb package for the console app after having already built the solution. However, the additional runtime identifiers cause subsequent builds of the solution to fail. The only way I can get it to work is in the following order:

  1. Build the solution with the "win-x86 runtime identifiers in the server and common projects
  2. Run the "dotnet publish" command in the server console app project
  3. Insert the additional "linux-x64" runtime identifiers into the server and common projects
  4. Run the "dotnet deb" command to create a debian package.

Having to do the 3rd step is causing problems. It allows creation of a deb package but breaks the build.

@jb0490 commented on GitHub (Feb 3, 2022): I have a similar problem: 1 solution with 13 projects divided among 3 folders. 2 app folders (client and server) and 1 common folder. The client folder has 5 projects: 1 UWP app project and 4 library projects. The common folder has 3 library projects. The server folder has 5 projects: 1 .net core 3.1 console app project and 4 library projects. All 11 library projects are .net standard 2.0. I installed the tool package in the server console app project. However, I cannot create a deb package unless I add runtime identifier "linux-x64" to all the server and common projects. These 8 projects already contain a runtime identifier for "win-x86". Inserting an additional "linux-x86" runtime identifier to each of the 8 projects allows me to create a deb package for the console app after having already built the solution. However, the additional runtime identifiers cause subsequent builds of the solution to fail. The only way I can get it to work is in the following order: 1. Build the solution with the "win-x86 runtime identifiers in the server and common projects 2. Run the "dotnet publish" command in the server console app project 3. Insert the additional "linux-x64" runtime identifiers into the server and common projects 4. Run the "dotnet deb" command to create a debian package. Having to do the 3rd step is causing problems. It allows creation of a deb package but breaks the build.
Author
Owner

@chylex commented on GitHub (Feb 18, 2022):

When I try dotnet tarball inside a project folder, the $(SolutionDir) variable is set to *Undefined* which breaks the build.

@chylex commented on GitHub (Feb 18, 2022): When I try `dotnet tarball` inside a project folder, the `$(SolutionDir)` variable is set to `*Undefined*` which breaks the build.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#109