Cannot package before publish. #53

Open
opened 2026-01-29 16:28:17 +00:00 by claunia · 4 comments
Owner

Originally created by @claunia on GitHub (Jun 21, 2019).

@qmfrederik oh you here also! 😃

May be related to #90 and #97, even a duplicate, not entirely sure.

Solution is a aspdotnetcore 2.2 package with a netcoreapp2.2 library.

Nuget for packaging added only to the main package.

claunia@dcsllinux /mnt/datos/Source/repos/XXXX/XXXX $ dotnet deb -f netcoreapp2.2 -r ubuntu.16.10-x64
dotnet Debian/Ubuntu installer package (0.1.78+708c0e30c3)
Microsoft (R) Build Engine version 15.9.20.63311 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

/mnt/datos/Source/repos/XXXX/XXXX/LibraryProject/LibraryProject.csproj : error MSB4057: The target "CreateDeb" does not exist in the project.
/opt/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1047: Assets file '/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/ubuntu.16.10-x64'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. You may also need to include 'ubuntu.16.10-x64' in your project's RuntimeIdentifiers. [/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/AspDotNetProject.csproj]

If I add it to the library also:

claunia@dcsllinux /mnt/datos/Source/repos/XXXX/XXXX $ dotnet deb -f netcoreapp2.2 -r ubuntu.16.10-x64
dotnet Debian/Ubuntu installer package (0.1.78+708c0e30c3)
Microsoft (R) Build Engine version 15.9.20.63311 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

/opt/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1047: Assets file '/mnt/datos/Source/repos/XXXX/XXXX/LibraryProject/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/ubuntu.16.10-x64'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. You may also need to include 'ubuntu.16.10-x64' in your project's RuntimeIdentifiers. [/mnt/datos/Source/repos/XXXX/XXXX/LibraryProject/LibraryProject.csproj]
/opt/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1047: Assets file '/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/ubuntu.16.10-x64'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. You may also need to include 'ubuntu.16.10-x64' in your project's RuntimeIdentifiers. [/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/AspDotNetProject.csproj]

They just stop there

Now, if I do

dotnet publish -f netcoreapp2.2 -r ubuntu.16.10-x64

first, then

dotnet deb -f netcoreapp2.2 -r ubuntu.16.10-x64

in the first case it keeps complaining about CreateDeb missing, but continues.
in the second case, no complains or warnings, it just works.

Originally created by @claunia on GitHub (Jun 21, 2019). @qmfrederik oh you here also! :smiley: May be related to #90 and #97, even a duplicate, not entirely sure. Solution is a aspdotnetcore 2.2 package with a netcoreapp2.2 library. Nuget for packaging added only to the main package. ``` claunia@dcsllinux /mnt/datos/Source/repos/XXXX/XXXX $ dotnet deb -f netcoreapp2.2 -r ubuntu.16.10-x64 dotnet Debian/Ubuntu installer package (0.1.78+708c0e30c3) Microsoft (R) Build Engine version 15.9.20.63311 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. /mnt/datos/Source/repos/XXXX/XXXX/LibraryProject/LibraryProject.csproj : error MSB4057: The target "CreateDeb" does not exist in the project. /opt/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1047: Assets file '/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/ubuntu.16.10-x64'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. You may also need to include 'ubuntu.16.10-x64' in your project's RuntimeIdentifiers. [/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/AspDotNetProject.csproj] ``` If I add it to the library also: ``` claunia@dcsllinux /mnt/datos/Source/repos/XXXX/XXXX $ dotnet deb -f netcoreapp2.2 -r ubuntu.16.10-x64 dotnet Debian/Ubuntu installer package (0.1.78+708c0e30c3) Microsoft (R) Build Engine version 15.9.20.63311 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. /opt/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1047: Assets file '/mnt/datos/Source/repos/XXXX/XXXX/LibraryProject/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/ubuntu.16.10-x64'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. You may also need to include 'ubuntu.16.10-x64' in your project's RuntimeIdentifiers. [/mnt/datos/Source/repos/XXXX/XXXX/LibraryProject/LibraryProject.csproj] /opt/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1047: Assets file '/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/ubuntu.16.10-x64'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. You may also need to include 'ubuntu.16.10-x64' in your project's RuntimeIdentifiers. [/mnt/datos/Source/repos/XXXX/XXXX/AspDotNetProject/AspDotNetProject.csproj] ``` They just stop there Now, if I do ``` dotnet publish -f netcoreapp2.2 -r ubuntu.16.10-x64 ``` first, then ``` dotnet deb -f netcoreapp2.2 -r ubuntu.16.10-x64 ``` in the first case it keeps complaining about CreateDeb missing, but continues. in the second case, no complains or warnings, it just works.
Author
Owner

@claunia commented on GitHub (Jun 21, 2019):

Also if I publish with two different RIDs (or a dozen), creating the package only works with the latest published RID.

@claunia commented on GitHub (Jun 21, 2019): Also if I publish with two different RIDs (or a dozen), creating the package only works with the latest published RID.
Author
Owner

@qmfrederik commented on GitHub (Jun 24, 2019):

@claunia It's a small world indeed 😄

Yes, I think this is a variant of the other issues, in that you need to do a restore before you can run dotnet deb.

We should probably update the .NET utilities to do an implicit restore if required. That should fix these issues.

For multiple RIDs, that's odd, because we use it to publish to different RIDs all the time.
Do you have a small sample project you can share?

@qmfrederik commented on GitHub (Jun 24, 2019): @claunia It's a small world indeed 😄 Yes, I think this is a variant of the other issues, in that you need to do a _restore_ before you can run `dotnet deb`. We should probably update the .NET utilities to do an implicit restore if required. That should fix these issues. For multiple RIDs, that's odd, because we use it to publish to different RIDs all the time. Do you have a small sample project you can share?
Author
Owner

@claunia commented on GitHub (Jun 24, 2019):

Unfortunately I don't have a small project, but it's easy to check:

dotnet publish -f netcoreapp2.2 -r ubuntu.16.04-x64
dotnet publish -f netcoreapp2.2 -r ubuntu.18.04-x64
dotnet deb -f netcoreapp2.2 -r ubuntu.16.04-x64
dotnet deb -f netcoreapp2.2 -r ubuntu.18.04-x64

Ubuntu 16.04 .deb generation fails, only 18.04 is generated.

Meanwhile

dotnet publish -f netcoreapp2.2 -r ubuntu.16.04-x64
dotnet deb -f netcoreapp2.2 -r ubuntu.16.04-x64
dotnet publish -f netcoreapp2.2 -r ubuntu.18.04-x64
dotnet deb -f netcoreapp2.2 -r ubuntu.18.04-x64

Both .deb packages are generated correctly.

@claunia commented on GitHub (Jun 24, 2019): Unfortunately I don't have a small project, but it's easy to check: ``` dotnet publish -f netcoreapp2.2 -r ubuntu.16.04-x64 dotnet publish -f netcoreapp2.2 -r ubuntu.18.04-x64 dotnet deb -f netcoreapp2.2 -r ubuntu.16.04-x64 dotnet deb -f netcoreapp2.2 -r ubuntu.18.04-x64 ``` Ubuntu 16.04 .deb generation fails, only 18.04 is generated. Meanwhile ``` dotnet publish -f netcoreapp2.2 -r ubuntu.16.04-x64 dotnet deb -f netcoreapp2.2 -r ubuntu.16.04-x64 dotnet publish -f netcoreapp2.2 -r ubuntu.18.04-x64 dotnet deb -f netcoreapp2.2 -r ubuntu.18.04-x64 ``` Both .deb packages are generated correctly.
Author
Owner

@qmfrederik commented on GitHub (Nov 22, 2019):

@claunia If you're still into this, can you give the latest version a try? You should no longer be required to run dotnet restore or dotnet publish before running dotnet deb, but it would be good to get confirmation 😄

fcarlier@fcarlier:~/issue-102$ cat issue-102.csproj 
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <RootNamespace>issue_102</RootNamespace>
    <RuntimeIdentifiers>ubuntu.16.04-x64;ubuntu.18.04-x64</RuntimeIdentifiers>
  </PropertyGroup>

</Project>
fcarlier@fcarlier:~/issue-102$ dotnet deb -r ubuntu.16.04-x64
dotnet deb (0.1.109+bbcf4baf5b)
Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  issue-102 -> /home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/issue-102.dll
  issue-102 -> /home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/publish/
  Creating DEB package '/home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/issue-102.1.0.0.ubuntu.16.04-x64.deb' from folder 'bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/publish/'
  Created DEB package '/home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/issue-102.1.0.0.ubuntu.16.04-x64.deb' from folder 'bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/publish/'
fcarlier@fcarlier:~/issue-102$ dotnet deb -r ubuntu.18.04-x64
dotnet deb (0.1.109+bbcf4baf5b)
Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  issue-102 -> /home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/issue-102.dll
  issue-102 -> /home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/publish/
  Creating DEB package '/home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/issue-102.1.0.0.ubuntu.18.04-x64.deb' from folder 'bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/publish/'
  Created DEB package '/home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/issue-102.1.0.0.ubuntu.18.04-x64.deb' from folder 'bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/publish/'
fcarlier@fcarlier:~/issue-102$ 
@qmfrederik commented on GitHub (Nov 22, 2019): @claunia If you're still into this, can you give the latest version a try? You should no longer be required to run `dotnet restore` or `dotnet publish` before running `dotnet deb`, but it would be good to get confirmation :smile: ```bash fcarlier@fcarlier:~/issue-102$ cat issue-102.csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp3.0</TargetFramework> <RootNamespace>issue_102</RootNamespace> <RuntimeIdentifiers>ubuntu.16.04-x64;ubuntu.18.04-x64</RuntimeIdentifiers> </PropertyGroup> </Project> fcarlier@fcarlier:~/issue-102$ dotnet deb -r ubuntu.16.04-x64 dotnet deb (0.1.109+bbcf4baf5b) Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. issue-102 -> /home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/issue-102.dll issue-102 -> /home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/publish/ Creating DEB package '/home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/issue-102.1.0.0.ubuntu.16.04-x64.deb' from folder 'bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/publish/' Created DEB package '/home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/issue-102.1.0.0.ubuntu.16.04-x64.deb' from folder 'bin/Debug/netcoreapp3.0/ubuntu.16.04-x64/publish/' fcarlier@fcarlier:~/issue-102$ dotnet deb -r ubuntu.18.04-x64 dotnet deb (0.1.109+bbcf4baf5b) Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. issue-102 -> /home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/issue-102.dll issue-102 -> /home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/publish/ Creating DEB package '/home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/issue-102.1.0.0.ubuntu.18.04-x64.deb' from folder 'bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/publish/' Created DEB package '/home/fcarlier/issue-102/bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/issue-102.1.0.0.ubuntu.18.04-x64.deb' from folder 'bin/Debug/netcoreapp3.0/ubuntu.18.04-x64/publish/' fcarlier@fcarlier:~/issue-102$ ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#53