Giter Club home page Giter Club logo

Comments (17)

jojorne avatar jojorne commented on July 18, 2024 1

I've been using Visual Studio on this machine for over a year now. I think that during this time, perhaps during some update, there were leftovers left behind.

I recently decided to use Avalonia. Everything installed and ran flawlessly. But then, I heard about how Uno uses MVUX and decided to give it a try. I ran uno-check, installed everything it asked for, including Android's command-line... 5? Really?! Okay... So I created a project following the docs using:

dotnet new unoapp -preset=recommended -o test

Note that The solution in VS will ask to install that specific version of the SDK (at the top of the solution explorer).

The solution, yes, but not uno-check. And only when all workloads are correctly installed. So, continuing...

I tried to run the project and... it failed. It said that I had to install more workloads. A window appeared, as you said, but it said instead - congratulations, you have everything installed, everything is ok, ready to go. - I closed the window and tried to run the project once more, but the message repeated - please install more workloads! So I uninstalled all Visual Studio workloads and reinstalled to no avail. There was never an installation failure message, note, as this is important later. The 3rd time, I decided to uninstall Visual Studio completely. Nothing...

Can you provide the warning that you got? f the build was not working, how did you noticed it crashed?

When I gave up and went back to Avalonia, as everything was working there, that was when I saw the first error message.

The result "" of evaluating the value "$(MonoTargetsTasksAssemblyPath)" of the "AssemblyFile" attribute in element <UsingTask> is not valid.  WasmApp.Native.targets

I concluded that this came from the dotnet installation. So I tried to repair all dotnet workloads from the command line. This message was what I received:

Removing <Package> ...... Failed
Warning: Workload garbage collection failed with error: Failed to remove

The message only appeared once and then the installation completed immediately afterwards. Again, this is not an error, is a warning with yellow letters. From the message, it is possible to conclude that the garbage collector failed to remove something because it does not exist, but the installation was successful. The first package was MonoAOTCompiler. Somehow, I managed to recover this package, but another package, MonoTargets, showed the same message.

Also, can you provide a binlog? https://platform.uno/docs/articles/uno-builds-troubleshooting.html.

Since I managed to recover the installation, everything is working now. Binlog is useless now, sorry.

The tool for generating images does not use the windows SDK, so I'm surprised that you experienced this issue.

I don't know. Visual Studio installs the Windows 11 SDK, version 10.0.22.621.0 by default. However, Uno creates projects using "net8.0-windows10.0.19041". Therefore, now yes, the solution asks to install this version of the SDK. So until you install Windows 10 SDK version 10.0.19041.0, you receive the error: using Uno.Resizetizer is not available. Just to give you an idea, I can't even update Resizetizer to version 1.4.10 as it says prohibited by project. Not even Avalonia gave me that much trouble.

from uno.

jojorne avatar jojorne commented on July 18, 2024 1

The issue that you're encountering is this one, when assets are missing (the last section of the page).

They are there:

image
image

Try the renaming thing: "net8.0-windows" instead of "net8.0-windows10.0.19041".

I changed it thinking it would update the SDK requirement. I didn't know about .vsconfig, it doesn't appear in the IDE.

from uno.

jojorne avatar jojorne commented on July 18, 2024 1

See, the exit code is 0. So not even uno-check can catch it >.<'
https://github.com/unoplatform/uno.check/blob/main/UnoCheck/DotNet/DotNetWorkloadManager.cs#L101

It needs to search the output for the warning, something between:

Warning: Workload garbage collection failed with error:

Although, it is just an indication that you may have a faulty workload installation.

Search results:

from uno.

jeromelaban avatar jeromelaban commented on July 18, 2024 1

Thank you for the update. Feel free to open additional discussions if things are not obvious.

from uno.

jojorne avatar jojorne commented on July 18, 2024 1

I'm just gonna leave this here for posterity.

net8.0-windowsTargetPlatformVersion

Valid TargetPlatformVersion versions for Windows:
10.0.22621.0
10.0.22000.0
10.0.20348.0
10.0.19041.0
10.0.18362.0
10.0.17763.0
10.0.22000.0
10.0.20348.0
10.0.19041.0
10.0.18362.0
10.0.17763.0
8.0
7.0

from uno.

jeromelaban avatar jeromelaban commented on July 18, 2024

Thanks for letting us know.

Can you provide the warning that you got? f the build was not working, how did you noticed it crashed?

Note that The solution in VS will ask to install that specific version of the SDK (at the top of the solution explorer). Also, the tool for generating images does not use the windows SDK, so I'm surprised that you experienced this issue.

from uno.

jeromelaban avatar jeromelaban commented on July 18, 2024

Also, can you provide a binlog? https://platform.uno/docs/articles/uno-builds-troubleshooting.html.

from uno.

jeromelaban avatar jeromelaban commented on July 18, 2024

I've been using Visual Studio on this machine for over a year now. I think that during this time, perhaps during some update, there were leftovers left behind.

This may be. We're trying our best to catch as many of these scenarios as possible, yet there are combination that either VS, dotnet or us miss.

I recently decided to use Avalonia. Everything installed and ran flawlessly. But then, I heard about how Uno uses MVUX and decided to give it a try. I ran uno-check, installed everything it asked for, including Android's command-line... 5? Really?! Okay...

Indeed, CLI for android v5 is not useful, we'll bump it to the more recent 11.0.

So I created a project following the docs using:

dotnet new unoapp -preset=recommended -o test

Note that The solution in VS will ask to install that specific version of the SDK (at the top of the solution explorer).

The solution, yes, but not uno-check. And only when all workloads are correctly installed. So, continuing...
I tried to run the project and... it failed. It said that I had to install more workloads.

When talking about workloads, which error was this? Was this "error window" error? We know that something similar may happen web .NET 9 Previews are installed on the machine. Uno.Check by default only installs for .NET 8.

Could you paste here the output of a run of uno-check on your machine ?

A window appeared, as you said, but it said instead - congratulations, you have everything installed, everything is ok, ready to go. - I closed the window and tried to run the project once more, but the message repeated - please install more workloads! So I uninstalled all Visual Studio workloads and reinstalled to no avail. There was never an installation failure message, note, as this is important later. The 3rd time, I decided to uninstall Visual Studio completely. Nothing...

Same here, where were those messages? Microsoft's terminology may be confusing, because there are .NET workloads, and VS workloads.

Also, can you provide a binlog? https://platform.uno/docs/articles/uno-builds-troubleshooting.html.

Since I managed to recover the installation, everything is working now. Binlog is useless now, sorry.

The tool for generating images does not use the windows SDK, so I'm surprised that you experienced this issue.

I don't know. Visual Studio installs the Windows 11 SDK, version 10.0.22.621.0 by default. However, Uno creates projects using "net8.0-windows10.0.19041". Therefore, now yes, the solution asks to install this version of the SDK. So until you install Windows 10 SDK version 10.0.19041.0, you receive the error: using Uno.Resizetizer is not available. Just to give you an idea, I can't even update Resizetizer to version 1.4.10 as it says prohibited by project. Not even Avalonia gave me that much trouble.

The net8.0-windows10.0.19041 target framework does not need to have the Windows SDK installed, everything it needs comes from nuget, not from VS. To be sure I tested again that build scenario in a Windows Sandbox and it works as expected without any Windows SDK installed (regardless of the yellow banner asking for it).

As you got this particular error message, it likely caused by something else and if you're getting it again, we'd be interested to have build logs to determine the source of this error, as "using Uno.Resizetizer is not available" is not a message we know of.

from uno.

jojorne avatar jojorne commented on July 18, 2024

When talking about workloads, which error was this? Was this "error window" error? We know that something similar may happen web .NET 9 Previews are installed on the machine. Uno.Check by default only installs for .NET 8.

Could you paste here the output of a run of uno-check on your machine ?

This was on the first installation, a few days ago. There was no error, just - please, install the missing workloads. Congratulations, you have everything installed! - repetition. The system was unable to detect the broken installation, only that something was missing. What? Also unable to detect. I believe it was because MonoAOTCompiler was missing and couldn't pass the information.

Same here, where were those messages? Microsoft's terminology may be confusing, because there are .NET workloads, and VS workloads.

The first error was only detected when I gave up and I tried running Avalonia again. At the time, I was already starting to fix the packages with issues.

The net8.0-windows10.0.19041 target framework does not need to have the Windows SDK installed, everything it needs comes from nuget, not from VS. To be sure I tested again that build scenario in a Windows Sandbox and it works as expected without any Windows SDK installed (regardless of the yellow banner asking for it).

As you got this particular error message, it likely caused by something else and if you're getting it again, we'd be interested to have build logs to determine the source of this error, as "using Uno.Resizetizer is not available" is not a message we know of.

Uninstalling the SDK to see what happens here... Nope, it asks to install it again.

I suspect it's because of the .vsconfig created in the directory... Yep, I was correct. It has:

Microsoft.VisualStudio.Component.Windows10SDK.19041

Oh! I just found out why I couldn't build and was getting the error: using Uno.Resizetizer is not available. I discovered it because I opened the project in VSCode.

  • Run Visual Studio
  • Open "Tools > Android > Android Adb Command Prompt"
  • Execute:
    sdkmanager --licenses --verbose

Reinstalling everything again erased the licenses.

Nope, scratch that. I did this: "net8.0-windows" instead of "net8.0-windows10.0.19041".

Error (active)	CS0234	The type or namespace name 'Resizetizer' does not exist in the namespace 'Uno' (are you missing an assembly reference?)	Counter (net8.0-windows) App.xaml.cs	3

BTW, how do I update Resizetizer to version 1.4.10, is it even possible? I get the message - prohibited by project.

from uno.

jeromelaban avatar jeromelaban commented on July 18, 2024

This was on the first installation, a few days ago. There was no error, just - please, install the missing workloads. Congratulations, you have everything installed! - repetition. The system was unable to detect the broken installation, only that something was missing. What? Also unable to detect. I believe it was because MonoAOTCompiler was missing and couldn't pass the information.

Indeed, if the SDK is broken, uno-check can't detect that. It may have been the reinstallation of visual studio that fixed it.

Uninstalling the SDK to see what happens here... Nope, it asks to install it again.

I suspect it's because of the .vsconfig created in the directory... Yep, I was correct. It has:

Microsoft.VisualStudio.Component.Windows10SDK.19041

Indeed, this is a .vsconfig specific entry that requires to add it. We mention that it is needed for a very specific scenario that is when publishing winappsdk apps to the store. Thinking about it, that particular scenario makes it difficult to start with, and we'll be removing that requirement from the .vsconfig to make the getting started easier.

Nope, scratch that. I did this: "net8.0-windows" instead of "net8.0-windows10.0.19041".
BTW, how do I update Resizetizer to version 1.4.10, is it even possible? I get the message - prohibited by project.

The uno.sdk manages those versions, and while it possible to update them manually, in general it's not needed.

The issue that you're encountering is this one, when assets are missing (the last section of the page).

I wonder, where you following the Counter getting started to get to this point? We may need to change the steps to avoid hitting this issue when assets are missing.

Thanks for taking the time to write such detailed explanations of your experience, this is very useful to improve our onboarding experience.

from uno.

jojorne avatar jojorne commented on July 18, 2024

This is beside the point, but I'm adding this to .vscode\settings.json as it allows me to switch between them.

  "dotnet.preferCSharpExtension": false,
  "dotnet.server.useOmnisharp": false,

from uno.

jeromelaban avatar jeromelaban commented on July 18, 2024

They are there:

Thanks, then it may be another condition we do not know about. Could you share your current solution?

Try the renaming thing: "net8.0-windows" instead of "net8.0-windows10.0.19041".

net8.0-windows alone is not supported for WinAppSDK, it needs to be net8.0-windows10.0.19041 (or later than 19041 when needed).

Could you try removing this line:

using Uno.Resizetizer;

and this line:

MainWindow.SetWindowIcon();

it should get you further until we can find the reason why this error happens.

Thanks!

from uno.

jojorne avatar jojorne commented on July 18, 2024

Could you try removing this line:

using Uno.Resizetizer;

and this line:

MainWindow.SetWindowIcon();

it should get you further until we can find the reason why this error happens.

Thanks!

Removing and using net8.0-windows:

Error (active)	CS5001	Program does not contain a static 'Main' method suitable for an entry point

from uno.

jojorne avatar jojorne commented on July 18, 2024

Indeed, if the SDK is broken, uno-check can't detect that. It may have been the reinstallation of visual studio that fixed it.

It wasn't. Since it was a warning, not an error, Visual Studio completed successfully. It was a silent crash.

There is only one result for this error and is unanswered: dotnet/runtime#100484

from uno.

jojorne avatar jojorne commented on July 18, 2024

Could you paste here the output of a run of uno-check on your machine ?

uno-check.txt

from uno.

jeromelaban avatar jeromelaban commented on July 18, 2024

uno-check.txt

Thanks. A possible error about .NET 9 is out of the question, so this means that .NET workloads were installed properly. This only leaves visual studio workloads that requested to be installed.

Removing and using net8.0-windows:

Thanks this is expected as net8.0-windows is not supported by the uno.sdk, only net8.0-windows10.0.xxx supported.

Could you provide a zip file of your project so we can determine what could be incorrect?

Thanks!

from uno.

jojorne avatar jojorne commented on July 18, 2024

Thanks this is expected as net8.0-windows is not supported by the uno.sdk, only net8.0-windows10.0.xxx supported.

Could you provide a zip file of your project so we can determine what could be incorrect?

There's no need. I modified it just to see if it would stop asking for the SDK. I wasn't aware of .vsconfig before.

Everything is working fine.

from uno.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.