dwmkerr / consolecontrol

ConsoleControl is a C# class library that lets you embed a console in a WinForms or WPF application.
MIT License
723 stars 169 forks source link

How to port your repo to be used in .NET 6 winforms or even .NET 7? #59

Closed zydjohnHotmail closed 1 year ago

zydjohnHotmail commented 1 year ago

Hello: I found your repo, it seems to be very good design when I used it with .NET 5 winforms, however, since .NET 5 is already out of support, it is better to migrate to .NET 6, or even .NET 7, I believe Microsoft may release .NET 7 soon, within a few days or even a few hours. However, when I tried to port your code to .NET 6, I got very strange issue:

If I tried the following command to install NUGET package: PM> Install-Package ConsoleControl -Version 1.3.0 I got warning like: Warning NU1701 Package 'ConsoleControl 1.3.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.

If I just add reference to consolecontrol.dll in one C# WinForms project, when I open Forms Designer, and tried to add a new tab in toolbox, and choose items for toolbox, I can see the following message: The following controls were successfully added to the toolbox but are not enabled in the active designer. Even it seems not an error, but the result is: I can't see such item (custom control: consolecontrol) appear in toolbox, therefore, I can NOT drag and drop one onto Form1.

Let me know if you can change your repo, to make a new NUGET target .NET 6 or even .NET 7? My IDE: Visual Studio 2022 (Version: 17.3.6), OS: Windows 10 Pro (21H2) Thanks,

dwmkerr commented 1 year ago

Yes I'd love to upgrade and re-target the project, just very low on capacity at the moment, so looking for help if possible!