Could not load file or assembly 'System.Windows.Forms' in Net6
-
- Posts: 53
- Joined: Thu Aug 21, 2008 9:28 pm
- Location: Peru
Could not load file or assembly 'System.Windows.Forms' in Net6
Hi, I'm using Net 6, with a library-type project to generate a report that exports to PDF, but when executing I get the following error: "Could not load file or assembly 'System.Windows.Forms, Version=4.0. 0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified."
The libraries that I have installed are from Stimulsoft and are ".NETCoreApp3.1", which are supposed to be compatible with Net6
please your support
Regards
Milton
The libraries that I have installed are from Stimulsoft and are ".NETCoreApp3.1", which are supposed to be compatible with Net6
please your support
Regards
Milton
-
- Posts: 790
- Joined: Tue Sep 07, 2021 10:11 am
Re: Could not load file or assembly 'System.Windows.Forms' in Net6
Hello,
You should add a reference to the assembly, by using the following code:
Also please check our samples:
https://github.com/stimulsoft/Samples-N ... rms-CSharp
Thank you.
You should add a reference to the assembly, by using the following code:
Code: Select all
using System.Windows.Forms;
https://github.com/stimulsoft/Samples-N ... rms-CSharp
Thank you.
-
- Posts: 53
- Joined: Thu Aug 21, 2008 9:28 pm
- Location: Peru
Re: Could not load file or assembly 'System.Windows.Forms' in Net6
Hello Max
It is not a "Windows Form" project, I am working on a "Library" type project where Forms is not referenced.
It is not a "Windows Form" project, I am working on a "Library" type project where Forms is not referenced.
-
- Posts: 6265
- Joined: Tue Mar 20, 2018 5:34 am
Re: Could not load file or assembly 'System.Windows.Forms' in Net6
Hello,
You can remove that assembly from the (Referenced Assemblies) property of the report.
Thank you.
You can remove that assembly from the (Referenced Assemblies) property of the report.
Thank you.
-
- Posts: 53
- Joined: Thu Aug 21, 2008 9:28 pm
- Location: Peru
Re: Could not load file or assembly 'System.Windows.Forms' in Net6
Hello
The error occurs in the line where the "StiReport" is instantiated, not in the load of the report.
StiReport report = new StiReport();
In which report should I remove the reference?
The error occurs in the line where the "StiReport" is instantiated, not in the load of the report.
StiReport report = new StiReport();
In which report should I remove the reference?
-
- Posts: 6265
- Joined: Tue Mar 20, 2018 5:34 am
Re: Could not load file or assembly 'System.Windows.Forms' in Net6
Hello,
Please send us a sample project that reproduces the issue for analysis.
Thank you.
Please send us a sample project that reproduces the issue for analysis.
Thank you.
-
- Posts: 53
- Joined: Thu Aug 21, 2008 9:28 pm
- Location: Peru
Re: Could not load file or assembly 'System.Windows.Forms' in Net6
It was fixed by replacing "Stimulsoft.Reports.Engine" with "Stimulsoft.Reports.Enginee.NetCore".
Thanks for the support.
Thanks for the support.
-
- Posts: 790
- Joined: Tue Sep 07, 2021 10:11 am
Re: Could not load file or assembly 'System.Windows.Forms' in Net6
Hello,
You are welcome!
You are welcome!