web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

NAV 2013 .NET variable CAS policy error

(0) ShareShare
ReportReport
Posted on by 75

Hello,

I'm using the Microsoft POS library but I get this error when I call the constructor of a variable (PosExplorer):

"This method explicitly uses CAS policy, which has been obsoleted by the .NET Framework"

How can I solve this in NAV, I have been searching but I haven't find any solution which fits on NAV 2013.

Thank you!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Roberto Stefanetti Profile Picture
    12,998 on at

    hi,

    to bypass (if possible), try to fix .NET configuration checks adding "NetFx40_LegacySecurityPolicy " parameter (with visual studio works fine)

    On Nav server config file or on client config file (for server ord client addins) try to add this line:

    Microsoft.Dynamics.NAV.Server.exe.config file:

    <NetFx40_LegacySecurityPolicy enabled="true"/>

    if doesn't works try to add parameter only to runtime execution

    <runtime>

    <NetFx40_LegacySecurityPolicy enabled="true"/>

    </runtime>

    ....

    For example in past (Nav 2000) i added "Garbage collection" configuration on NAV passing standard .net "gcServer configuration" parameter (this is an undocumented feature but works fine if added and speed up nav servers)

    Microsoft.Dynamics.NAV.Server.exe.config file:

    <configuration>

    <runtime>

    <gcServer enabled="true"/>

    </runtime>

    </configuration>

    let me know if works.

  • Suggested answer
    Txema Mas Profile Picture
    75 on at

    Thanks! I tested it and it works!

    I noticed that in both  config files (client and server) of NAV 2013 R2 it comes activated by default . In previous versions that code line doesn't exists.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans