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

Add WinUI/Uno support #26

Closed
CastelloBrancoTecnologia opened this issue Nov 16, 2023 · 15 comments
Closed

Add WinUI/Uno support #26

CastelloBrancoTecnologia opened this issue Nov 16, 2023 · 15 comments
Labels
enhancement New feature or request

Comments

@CastelloBrancoTecnologia

I dont know how to make a pull request. I alredy done. Project is atached

Material.Icons.zip

@SKProCH SKProCH added the enhancement New feature or request label Nov 16, 2023
@SKProCH
Copy link
Owner

SKProCH commented Nov 16, 2023

I'll take a look at the weekend.

@SKProCH
Copy link
Owner

SKProCH commented Nov 18, 2023

Imported project in uno_winui branch. Spend a 2 hours trying to compile it with no success.
Errors:

5>Material.Icons.UNO.csproj: Error NU1012 : Platform version is not present for one or more target frameworks, even though they have specified a platform: net7.0-maccatalyst, net8.0-android, net8.0-ios
5>Microsoft.NET.TargetFrameworkInference.targets(121,5): Error NETSDK1208 : The target platform identifier ios was not recognized. This is because MSBuildEnableWorkloadResolver is set to false which disables .NET SDK Workloads which is required for this identifer. Unset this environment variable or MSBuild property to enable workloads.
5>Microsoft.NET.TargetFrameworkInference.targets(121,5): Error NETSDK1208 : The target platform identifier android was not recognized. This is because MSBuildEnableWorkloadResolver is set to false which disables .NET SDK Workloads which is required for this identifer. Unset this environment variable or MSBuild property to enable workloads.
5>Material.Icons.UNO.csproj: Error NU1012 : Platform version is not present for one or more target frameworks, even though they have specified a platform: net7.0-maccatalyst, net8.0-android, net8.0-ios
5>Microsoft.NET.TargetFrameworkInference.targets(121,5): Error NETSDK1208 : The target platform identifier maccatalyst was not recognized. This is because MSBuildEnableWorkloadResolver is set to false which disables .NET SDK Workloads which is required for this identifer. Unset this environment variable or MSBuild property to enable workloads.

Workloads:

Installed Workload Id      Manifest Version       Installation Source
---------------------------------------------------------------------
android                    34.0.43/8.0.100        SDK 8.0.100        
ios                        17.0.8478/8.0.100      SDK 8.0.100        
maui                       8.0.3/8.0.100          SDK 8.0.100        
maui-android               8.0.3/8.0.100          SDK 8.0.100        
maui-ios                   8.0.3/8.0.100          SDK 8.0.100

This is also the reason because i dont like uno and anything related.
Also, i think what library doesn't need to target all the net8.0;net8.0-ios;net7.0-maccatalyst;net8.0-android (but may be i wrong here), just netstandard or netX.0 or somthing.

If you manage to make it works property - send an instruction here, please.

@cesarchefinho
Copy link

cesarchefinho commented Nov 18, 2023

you need to install and run uno-check from command prompt

dotnet tool install --global Uno.Check --version 1.17.0

exit prompt

open promot again winth elevated privileges

uno-check --pre

it will install all componetnts, workloads, android adk, and whatever you need to compile uno in visual studio 2022

the last bit is

also in visual studio 2022, extensions, install uno extension to get Teamplates for new projects with uno.

Note that i used visual studio 2022 17.8 that is already net 8 and made libray for latest winui and net 8

@SKProCH
Copy link
Owner

SKProCH commented Nov 18, 2023

Hmm, i'll try. How this should work inside of CI workflow?

@SKProCH
Copy link
Owner

SKProCH commented Nov 18, 2023

I've run an Uno.Check and actually nothing is changed.

Here is the log: https://gist.github.com/SKProCH/b516c7c75a255b8137bd551f0e6c2311
Also, ! There were one or more problems detected., but i can't see any problems in the unocheck output.

Also, i don't have any Visual Studio installed and using Rider. But actually same build errors appears on just dotnet build command, so there is not problem with Rider.

Do you have any suggestions?

Also, i can try to compile it on the linux PC, probably there are less issues.

@SKProCH
Copy link
Owner

SKProCH commented Nov 18, 2023

Still no luck to build the library project on linux too.

/usr/share/dotnet/sdk/8.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1178: The project depends on the following workload packs that do not exist in any of the workloads available in this installation: Microsoft.ios.Sdk.net8 [/common/RiderProjects/Material.Icons/Material.Icons.UNO/Material.Icons.UNO.csproj::TargetFramework=net8.0-ios]
/usr/share/dotnet/sdk/8.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1178: You may need to build the project on another operating system or architecture, or update the .NET SDK. [/common/RiderProjects/Material.Icons/Material.Icons.UNO/Material.Icons.UNO.csproj::TargetFramework=net8.0-ios]

Running unocheck also doesn't help.

@cesarchefinho
Copy link

cesarchefinho commented Nov 18, 2023

Sorry, i never used rider with uno but it works and also with visual studio code.

there are an rider plugin for uno, you need to install it and also you need to install winappsdk 1.4 that ia required to buid winui3 applicatios (uno is winui3 for mutiplataform, but in windows it relies of winappsdk that comes with vs but not with rider)_

see more on

https://platform.uno/docs/articles/get-started-rider.html?tabs=windows

i also see this on jetbrains site

https://blog.jetbrains.com/dotnet/2020/11/16/working-with-uno-platform-and-rider/

@cesarchefinho
Copy link

Last thing, On linux you need to use visual studio code or rider to compile uno apps.

@SKProCH
Copy link
Owner

SKProCH commented Nov 18, 2023

To be honest i still doesn't get what i need to do to just build the library.

I don't actually need to work with uno projects inside the IDE. I want at least just compile it with dotnet build from the command line. But now i can't do it nether on windows or linux.

This info required to create a CI script which can build the nupkg file to publish it to nuget.org.

@cesarchefinho
Copy link

I will try to make an project that compile with CLand send to you.

If I cant get it working with CL I wil try an WinUi3 only project without uno that compile with CL

Thanks

@SKProCH
Copy link
Owner

SKProCH commented Nov 18, 2023

Not CLand, actually. By CI a mean Continuous Integration - GitHub Actions in this case.

Current pipeline to publish a packages to nuget listed here - https://github.com/SKProCH/Material.Icons/blob/master/.github/workflows/publish.yml

I need a script which results to creating a nuget package to publish it to nuget.org.
So, currently i can't figure out how to do it, since dotnet build refuses to work for me in uno projects.

@CastelloBrancoTecnologia
Copy link
Author

I maded an simplified version that only target to WinUI

Can you check if it works with your GitHubCL ?

If yes then in next weeks i will work with uno version and try again send to you, ok ?

thanks

And sorry to my mistakes with uno i will find the solution to it

Material.Icons.WinUI.zip

@cesarchefinho
Copy link

cesarchefinho commented Nov 24, 2023

To be honest i still doesn't get what i need to do to just build the library.

I don't actually need to work with uno projects inside the IDE. I want at least just compile it with dotnet build from the command line. But now i can't do it nether on windows or linux.

This info required to create a CI script which can build the nupkg file to publish it to nuget.org.

can you use

msbuild project.csproj -t:projecttobuild ? or something like this

also see my winui project please

thanks

@SKProCH
Copy link
Owner

SKProCH commented Nov 24, 2023

Still can't manage it to run. I've replaced uno projects with winui projects in this commit 8ce4682

In next commit I've setup the pipeline file (it actually calls the dotnet build Material.Icons.WinUI -c Release) to see if there's something wrong with the environment on my PC.

But no, all the builds failed.

Guys, I really don't have time to figure out why a simple project on WinUI and Uno can't just build. I find all these Microsoft attempts at UI frameworks (after WPF) cursed and don't see how it can be used, at least because their toolchain just doesn't work.

If you figure it out, and can fix the bugs so that you end up with a .nupkg file that I can upload to nuget.org - then let's get everything into the main branch. I just don't have time to figure out what's wrong again with this projects (WinUI, UNO), sorry.

Or, if you want - you can develop it in a separate repository, and I'll leave a link to your repository. Because I have neither time nor desire to support WinUI/Uno implementation anyway.

@CastelloBrancoTecnologia
Copy link
Author

OK. Created.

Please see at https://github.com/CastelloBrancoTecnologia/Material.Icons.UNO/

Feel free to say any mistakes maded by me.

@SKProCH SKProCH mentioned this issue Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants