How can I write code using vscode and dotnet command line that uses the PrintDialog class?
using vscode and .net sdk, I am trying to compile code that uses the PrintDialog class. In the vscode editor the code highlights with the error. And when I run dotnet run I get the message
error CS0246: The type or namespace name 'PrintDialog' could not be found (are you missing
a using directive or an assembly reference?) [C:\web\tester\dotnet\ch4\ch4.csproj]
I ran dotnet add package System.Windows.Forms . The result was :
error: There are no versions available for the package 'System.Windows.Forms'.
I did install the .NET Framework 4.8. But there was no "dotnet" command line. So I uninstalled and installed .NET 5.0 instead.
How can I write code using vscode and dotnet command line that uses the PrintDialog class?
thanks,