Posted 9 April 2020, 2:36 am EST
I’m working on a windows service, and I’m using active reports to generate a report each day. As these things usually go, on my machine it works fine, but when I push it to our development testing machine, I encounter the following error:
System.NotSupportedException: This method implicitly uses CAS policy, which has been obsoleted by the .NET Framework. In order to enable CAS policy for compatibility reasons, please use the NetFx40_LegacySecurityPolicy configuration switch. Please see http://go.microsoft.com/fwlink/?LinkID=155570 for more information.
This error occurs when I try and run the SectionReport.Run() method. Now, everywhere I look online and within my company tells me to add the following tag to the app.config file:
<NetFx40_LegacySecurityPolicy enabled=“true”/>
Having this tag in there causes a new error when trying to install the service on the test host:
Service ‘’ cannot be started due to the following error: Cannot start service on computer ‘.’.
I’ve created the license.licx file and added it to the project, and I’ve also used the ApplicationLicenseGenerator.exe to create a dll license file that gets referenced and pulled into the application.
Any advice would be helpful. Let me know if you need more info.