Friday, April 13, 2012 8:13 AM
I created a new project with framework 4, loading a custom assembly to populate certain fields of a report. The report was added using the method:
this.rpViewer.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("tstDat, Version=220.127.116.11, Culture=neutral, PublicKeyToken=null");
This threw this exception related to enable the CAS policy. I found the trick adding the following node in app.config:
And it worked fine.
Now, the problem is that I have this other project originally created with framework 3. I was recently required to upgrade it to framework 4. This project has also custom assemblies to populate report data.
I also use AddTrustedCodeModuleInCurrentAppDomain to load the assembly so I added the NetFx40_LegacySecurityPolicy node to app.config but it keeps throwing the exception I've mentioned before.
I added also the node
/>with the same result...
I'm lost on that. It seems the problem is only in the upgraded project. Does anyone know how to solve it?
I can't use the default framework 4 sandboxing because I need the custom assembly static property to populate some data from the report viewer container form and sandboxing keeps this data in a different domain, so the exception is not thrown but the property is empty.
- Edited by rikarth Monday, April 16, 2012 11:12 AM