unoplatform / uno.check

CLI tool to setup your environment to build Uno Platform apps
https://platform.uno
30 stars 17 forks source link

.NET SDK Checkup cannot be forced to check for SDK 7 when SDK 8 installed #222

Closed RonWright closed 9 months ago

RonWright commented 9 months ago

I have .NET SDK versions 7.0.404 and 8.0.100 installed. The .NET SDK Checkup... lists these SDK versions in the console window with 8.0.100 displayed in a different color indicating that this is the SDK that will be used. Using global.json file: { "sdk": { "version": "7.0.404", "allowPrerelease": false, "rollForward": "latestFeature" }, "tools": { "dotnet": "7.0.404" }, "msbuild-sdks": { "MSBuild.Sdk.Extras": "3.0.44" } } I need to target the 7.0.404 SDK in my project as I have a dependency on Windows.UI.Xaml namespace which is not available for any workloads that target 8.0.0 or higher. How can I resolve this?

jeromelaban commented 9 months ago

Thanks for the report. Uno check uses a default manifest that targets the version required when it was built.

If you need to run for a specific version, you'll need to use the --manifest and the url of a manifest that matches the version you're using.

To select a specific version:

In your case, for 7.0.404, it would be: https://raw.githubusercontent.com/unoplatform/uno.check/release/stable/1.16/manifests/uno.ui.manifest.json

That being said, if you're targeting uno, Windows.UI.Xaml should be available in .NET 8 as well. Which type is missing when you're targeting .NET 8 ?

Eiltherune commented 2 weeks ago

Can this information be added to the "Troubleshooting" section on platform.uno? No errors were showing up but it still said the check failed, so I ran it with the --verbose flag and it showed me that I'm using the .NET9.0 SDK but requesting .NET8.0. It said to update a global.json temp file to list the 9.0 SDK, but doing so was fruitless because as soon as I re-ran the check a new temp file was created in a new directory. After searching for an answer I found this 9 month old issue, but only by manually navigating to this repository. Adding a link to this repo's Issues page in Troubleshooting might also be helpful. Turned out I needed to use the preview-major manifest. All seems to be working now.