I have just created two projects in VS2019 for .NET Core 3.0 Winforms and WPF. The goal is to use new Winforms and WPF frameworks (did anyone tried them?). Here is the designer : Windows Forms Designer.
I found a few issues that I don’t understand :
- Water imports the project .csproj file but doesn’t add files. I checked that, inside .csproj there is no reference to .cs files so VS automatically adds all .cs?
- There are some new options inside the .csproj that may not be imported and the solution panel looks different :
- Project Sdk=“Microsoft.NET.Sdk.WindowsDesktop”
- Here are 3 projects repos.zip (798.4 KB)
WindowsFormsApp1 and WpfCustomControlLibrary1 were created using VS 2019.
ConsoleApplication9 was created in Water to check why some WPF types are unknown. I wanted to convert VS projects to Water to test new frameworks but have a problem with package microsoft.windowsdesktop.app.
Here is what NuGet References shows :
When I use a first reference (lowercase) then the project compiles but doesn’t recognize the types (ModifierKeys, Rect). So I changed in Settings SDK and Runtime to WindowsDesktop.App like this :
Now these types are recognized from System.Windows.Input but compiler reports error :
"E: Package Microsoft.WindowsDesktop.App matching version [3.0.0] was not found in any repositories."
How to solve these problems? It seems that the preview8 package is deprecated.
VS is using files from C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\3.0.0\ref\netcoreapp3.0
Is there a way to reference this directory?
- How are Settings \ SDK and Runtime related to nuget packages? How should I set them to use Winforms and WPF frameworks from .NET 3.0? How to modify ConsoleApplication9 to compile?
Thanks for any help and sorry for so many issues in one report.