Reputation: 113
We have .NET 6 Blazor Server-side project in Visual Studio 2022. We would like to use .Net Framework 4.8 class library in .NET 6. In this class library, we are using System.Windows.Form and we cannot recompile the class library with .NET Standard 2.0.
I have added .Net Framework 4.8 class library project as dependency for Blazor Application. I am able to compile the solution but when try to run the Blazor Application then it complaints with "System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.".
We would just like to run Blazor project in windows only.
Upvotes: 10
Views: 11319
Reputation: 9237
You can target newer .NET versions with inclusion of Windows forms.
See the official guidance
Upvotes: -1