AvaloniaVSCode icon indicating copy to clipboard operation
AvaloniaVSCode copied to clipboard

Issues with projects named "avalonia"

Open Loyal0713 opened this issue 8 months ago • 1 comments

Describe the bug

A low priority issue when running projects named avalonia resulting in errors

To Reproduce

  1. Create new project (in my case was using shortcut in VSCode
  2. Pick project type
  3. Named avalonia (did not test Avalonia or other combinations)
  4. Attempt to run avalonia.csproj
  5. 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.

Loyal0713 avatar Mar 24 '25 19:03 Loyal0713

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.

lextm avatar Aug 15 '25 10:08 lextm