I have a simple excel DNA add in, created in version 0.32.
In my add-in I am dynamically loading another assembly that is found on a network drive.
When I load my excel DNA add-in into Excel and run my Excel-DNA function, I get the following error :
{"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."}
I have created a .config file for the ExcelDNA project in Visual Studio as shown below :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="DbPath" value="testString"/>
</appSettings>
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true" />
<legacyCasPolicy enabled="true"/>
<loadFromRemoteSources enabled="true"/>
</runtime>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
</configuration>
Any ideas on how I can resolve this issue?
Any help would be much appreciated.