Amish Kumar
Amish Kumar

Reputation: 259

The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception

I am creating a web application which will run on a local machine. I am trying to write code on the print button.

While initializing new PosExplorer() I get the error:

The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception.".

In the inner exception: "This method explicitly 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."

I have installed microsoft POS for .net 1.12 and have also tried using NetFx40_LegacySecurityPolicy enabled="true" in the web.config as well as devenv.exe.config file, but none of them resolved my issue.

I am using vs 2010.

Any help will be highly thanked...

Upvotes: 0

Views: 2072

Answers (1)

Amish Kumar
Amish Kumar

Reputation: 259

Resolved the issue by adding

<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>

in to the path C:\Program Files\Common Files\microsoft shared\DevServer\10.0\WebDev.WebServer40.exe

And restart the development environment. Thanks

Upvotes: 3

Related Questions