AvaloniaVSCode
AvaloniaVSCode copied to clipboard
Issues with projects named "avalonia"
Describe the bug
A low priority issue when running projects named avalonia resulting in errors
To Reproduce
- Create new project (in my case was using shortcut in VSCode
- Pick project type
- Named
avalonia(did not testAvaloniaor other combinations) - Attempt to run
avalonia.csproj - Error:
C:\Program Files\dotnet\sdk\9.0.202\NuGet.targets(175,5): error : The given key '(Avalonia, 11.2.1)' was not present in the dictionary.
The build failed. Fix the build errors and run again.
Avalonia for VS Code
0.0.32
Avalonia version
No response
VS Code version
No response
Relevant log output
No output in Avalonia Client under Output panel. Only error I see was the executing error below:
C:\Program Files\dotnet\sdk\9.0.202\NuGet.targets(175,5): error : The given key '(Avalonia, 11.2.1)' was not present in the dictionary.
The build failed. Fix the build errors and run again.
Additional context
Came across this when I was migrating a WPF project to Avalonia, I had a wpf folder and wanted a avalonia folder. After renaming to ava, things worked as expected. If this can be fixed, great. If not, restricting/checking/warning about the project name would greatly help (novice) users know that their project isn't "broken" but just the project needs to be named differently when creating.
This is more of an issue related to .NET SDK itself. What I got from dotnet build is
➜ avalonia dotnet build
/Users/lextm/avalonia/avalonia.csproj : error NU1108:
Cycle detected.
avalonia -> Avalonia (>= 11.3.3).
Restore failed with 1 error(s) in 2.2s
which makes perfect sense. You cannot name a project that way in the first place.