NAV 2013 .NET variable CAS policy error

TxemaMas
Member Posts: 3
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!
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!
0
Answers
-
Without knowing the problem in detail it does seem as if this is due to the new CAS policy in .Net 4.5.
What I would recommend trying is to add the line <NetFx40_LegacySecurityPolicy enabled="true"/> to the exe.config file (Microsoft.Dynamics.Nav.Server.exe.config) usually found in the folder C:\Program Files\Microsoft Dynamics NAV\71\Service.
From your mail I cannot determine if it is a client side add-in that fails. If so then you need to modify the exe.config file for the client.
Not sure that this will work - but it is worth trying out.Best regards,
Jens Møller-Pedersen [MSFT]
This posting is provided 'AS IS' with no warranties, and confers no rights.0 -
Thanks for your answer, 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.0 -
Yes, we decided to turn on this behavior by default in 2013 R2. This can give problems if an add-in uses the Dynamic Language Runtime in which case the corresponding .config file has to contain the config value = false (or removed).
We do hope that we got it right in assuming that the chosen default would benefit the majority of partners.
However, it is likely that the legacy security policy will get discontinued in a later version of .Net - but I have not heard of any plans of that yet.Best regards,
Jens Møller-Pedersen [MSFT]
This posting is provided 'AS IS' with no warranties, and confers no rights.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions