Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop TFM Packaging Support #16440

Open
5 of 16 tasks
jeromelaban opened this issue Apr 24, 2024 · 13 comments
Open
5 of 16 tasks

Desktop TFM Packaging Support #16440

jeromelaban opened this issue Apr 24, 2024 · 13 comments
Labels
area/skia ✏️ Categorizes an issue or PR as relevant to Skia difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. epic kind/enhancement New feature or request project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools

Comments

@jeromelaban
Copy link
Member

jeromelaban commented Apr 24, 2024

What would you like to be added

Add support for publishing to different platform specific packages:

known issues

Why is this needed

No response

For which platform

No response

Anything else we need to know?

No response

Additional resources

@jeromelaban jeromelaban added kind/enhancement New feature or request triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. epic project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools and removed triage/untriaged Indicates an issue requires triaging or verification labels Apr 24, 2024
@jeromelaban jeromelaban changed the title [] Desktop TFM Packaging Desktop TFM Packaging Support Apr 24, 2024
@jeromelaban jeromelaban added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Apr 24, 2024
@ramezgerges
Copy link
Contributor

I would also suggest packaging for Flatpak. AppImages are pretty much on life support, so I'm not sure if it's worth the effort.

@jeromelaban
Copy link
Member Author

If anyone is tracking this issue, I've added some links to known macOS and Linux packaging samples in the original post.

@TopperDEL
Copy link
Contributor

If anyone is tracking this issue, I've added some links to known macOS and Linux packaging samples in the original post.

This is not working for my app. I've added the Dotnet.Bundle-Nuget to my Uno-Project (single project, Uno 5.2). Then I tried building it with this command:
dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=net8.0-desktop

It states The target BundleApp does not exist in the project. According to this issue I also tried adding a TargetFramework-Parameter:
dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=net8.0-desktop -p:TargetFramework=net8.0
This leads to the same error. Any hints?

@ArchieCoder
Copy link
Contributor

@TopperDEL I had the same error as you.

I was able to make the command line ran successfully:

  • I fixed the RuntimeIdentififer to osx-arm64
  • Added CFBundleShortVersionString
  • Added restore

dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-arm64 -p:TargetFramework=net8.0-desktop /p:CFBundleShortVersionString=1.0.0 -restore

Please let me know if it works. I have the publish folder, but I don't know what else to do with it.

@TopperDEL
Copy link
Contributor

Hm, I get the error C:\Program Files\dotnet\sdk\8.0.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(117,5): error NETSDK1139: Der Zielplattformbezeichner "desktop" wurde nicht erkannt. (TargetFramework-name "desktop" not recognized) for all of my library projects.

@TopperDEL
Copy link
Contributor

@jeromelaban May you clarifiy how bundeling for macOs could work? I would love to get a *.pkg for the net8.0-desktop targeting macOS.

@ArchieCoder
Copy link
Contributor

@TopperDEL did you use the same line as me?

@TopperDEL
Copy link
Contributor

Exactly the same, yes. But I have a quite huge solution already with many library-projects. May you add one library to your project and see if that works? This is a sample of a library that crashed with the above "desktop not recognized"-error:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="MvvmGen"/>
    <PackageReference Include="SharpHash"/>
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\myapp.Contracts\myapp.Contracts.csproj" />
    <ProjectReference Include="..\myapp.Services\myapp.Services.csproj" />
  </ItemGroup>
</Project>

@jeromelaban
Copy link
Member Author

Hm, I get the error C:\Program Files\dotnet\sdk\8.0.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(117,5): error NETSDK1139: Der Zielplattformbezeichner "desktop" wurde nicht erkannt. (TargetFramework-name "desktop" not recognized) for all of my library projects.

This generally means that the Sdk specified at the root of the csprojs is not Uno.Sdk.

@jeromelaban May you clarifiy how bundeling for macOs could work? I would love to get a *.pkg for the net8.0-desktop targeting macOS.

It's not defined at this point, but intuitively, dotnet publish would generate a .pkg or a .app.

@TopperDEL
Copy link
Contributor

Hm, I get the error C:\Program Files\dotnet\sdk\8.0.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(117,5): error NETSDK1139: Der Zielplattformbezeichner "desktop" wurde nicht erkannt. (TargetFramework-name "desktop" not recognized) for all of my library projects.

This generally means that the Sdk specified at the root of the csprojs is not Uno.Sdk.

Are class libraries meant to also use Uno.Sdk?

@jeromelaban May you clarifiy how bundeling for macOs could work? I would love to get a *.pkg for the net8.0-desktop targeting macOS.

It's not defined at this point, but intuitively, dotnet publish would generate a .pkg or a .app.

Who is in charge to define this? Is this a Microsoft-thing?

@jeromelaban
Copy link
Member Author

Are class libraries meant to also use Uno.Sdk?

If you want to use Uno in this class library, yes.

Who is in charge to define this? Is this a Microsoft-thing?

It will be an Uno Platform feature.

@TopperDEL
Copy link
Contributor

So a "normal" class-library (containing only C#-code) does not need to Reference the Uno.Sdk. Hm. Still wondering where this error comes from then.

I'm looking forward to have the PKG/APP-support. Thanks for your awesome work!

@jeromelaban
Copy link
Member Author

So a "normal" class-library (containing only C#-code) does not need to Reference the Uno.Sdk. Hm. Still wondering where this error comes from then.

Normal class libraries should not be showing this error. If you can repro that specific behavior, please open an issue with more details. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/skia ✏️ Categorizes an issue or PR as relevant to Skia difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. epic kind/enhancement New feature or request project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools
Projects
None yet
Development

No branches or pull requests

4 participants