icsharpcode / AvalonEdit

The WPF-based text editor component used in SharpDevelop
http://avalonedit.net/
MIT License
1.85k stars 469 forks source link

Problem with target framework moniker #379

Open AlexeiScherbakov opened 1 year ago

AlexeiScherbakov commented 1 year ago

Recently I detected problem with TargetFrameworkMoniker in RoslynPad. It have only net6.0-windows7 and cannot be used in standard net6.0-windows projects. https://github.com/roslynpad/roslynpad/issues/450

AvalonEdit nuget also has net6.0-windows7 and net5.0-windows7 target framework moniker which will be not consumed by projects with net6.0-windows moniker - they will use netcoreapp3.1. AvalonEdit project itself has correct net6.0-windows target framework moniker, but nuget package has other monikers, why?

christophwille commented 1 year ago

There are some threads like https://github.com/dotnet/sdk/issues/14553 - I have no idea how to fix this (they claim the TFMs are equivalent). If you come across an actionable thread please let me know.

christophwille commented 1 year ago

I checked a couple others:

https://www.nuget.org/packages/ModernWpfUI/0.9.7-preview.2#supportedframeworks-body-tab https://www.nuget.org/packages/TomsToolbox.Wpf#supportedframeworks-body-tab

Those all have -windows7.0

christophwille commented 1 year ago

Ran a quick test with ILSpy - which is targeting net6.0-windows (see ILSpy.csproj). I cleaned out all bin/obj directories, and then went into C:\Users\YOURUSERNAMEHERE.nuget\packages\avalonedit\6.1.3.50\lib and deleted everything but the net6.0-windows7.0 directory. Then hit Rebuild.

The build works a-ok, and ILSpy.deps.json shows me the following after Build:

      "AvalonEdit/6.1.3.50": {
        "runtime": {
          "lib/net6.0-windows7.0/ICSharpCode.AvalonEdit.dll": {
            "assemblyVersion": "6.1.3.50",
            "fileVersion": "6.1.3.50"
          }
AlexeiScherbakov commented 1 year ago

Manual installation of RoslynPad and building it later (after nuget cache it inside .nuget directory) also works for me. Something is broken inside VS<->NuGet. Visual Studio simple down't download RoslynPad.Editor.Windows) May be it is only for Visual Studio?