惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

博客园 - cloud

将博客搬至CSDN Microsoft Dynamics CRM 解决数据大于5000时,页面上只能导出5000+数据。 AX7 VM can not starting AX3空Invoice明细问题 Solution to “VirtualBox can't operate in VMX root mode” error in Windows 7 Inventory of the materials to teach you how to query a date certain combination of dimensions How to Debug Enterprise Portal Code in Dynamics AX 2009 Axapta 3 COM Connector AX 与Citrix打印机问题 AX ERP 真正的自动批处理 SQL语句转摘 AX2012 R2 打开EP站点时提示503 Service Unavailable错误。 AX2012 R2安装 AX3在window8下兼容性 转:Configure system accounts-AX2009 转:Workflow iPhone Application 转:Dynamics AX2009 Workflow – Checklist-Mail alert 转:AX 2009 Workflows: A Quick overview Dynamics AX2009 Report step by step
转 Request for the permission of type 'InteropPermission' failed.
cloud · 2012-08-27 · via 博客园 - cloud

http://blog.davidsandor.com/post/2009/07/16/Request-for-the-permission-of-type-InteropPermission-failed.aspx

http://dynamics-ax-live.blogspot.com.au/2009/09/error-request-for-permission-of-type.html

I am working with Microsoft Dynamics AX 2009 and when calling a method on one of my C# assemblies from X++ I got the error:

Request for the permission of type 'InteropPermission' failed.

image

After reading a few misguided newsgroup postings I found this article showing how to get around the error. Apparently in Axapta 2009 the hosted CLR requires that you assert permissions before you make a call to your assembly.

http://msdn.microsoft.com/en-us/library/bb190039.aspx

So I modified my code to include the InteropPermission class, instantiated it as a new object and called assert. Well I immediately noticed that I needed to construct the InteropPermission class with an InteropKind enumerator. So after a quick search I found this article:

http://msdn.microsoft.com/en-us/library/aa605505.aspx

Long story short, you can call your CLR code by using code like this:

   1:  void sendSalesOrderConfirmNotification(str salesOrderNumber)
   2:  {
   3:      XppNotifier.Notifier notifier;
   4:      XppNotifier.NotificationType notificationType;
   5:      InteropConfigTable iConfig;
   6:      KeyDataType key;
   7:      InteropPermission perm;
   8:    ;
   9:   
  10:      key = "NotificationMSMQQueuePath";
  11:      perm = new InteropPermission( InteropKind::ClrInterop );
  12:      perm.assert();
  13:   
  14:      notifier = new XppNotifier.Notifier();
  15:      notifier.FireNotification(iConfig.getValue(key), salesOrderNumber,  "", "", XppNotifier.NotificationType::SalesOrderConfirmation);
  16:   
  17:    info("Sales order confirmed, sending notifications: SalesId: " + salesOrderNumber);
  18:   
  19:   
  20:  }

Note: My C# assembly is the XppNotifier. I have to create an InteropPermission variable at line 7. Then at line 11 I instantiate the InteropPermission class. I pass in the ClrInterop enum because I am requesting access to call my C# assembly. On line 12 I make the assertion. This basically says to the CLR “Hey, I want to run some managed code. Is this cool?” the CLR then either throws a Code Access Security exception (CAS Exception) or returns quietly. However now, the current application domain that is executing has the right to invoke the C# assembly.

第二篇:

Error: "Request for the permission of type 'InteropPermission' failed."

Hi there,

Here's another error message you may come across in Dynamics Ax:

Error: "Request for the permission of type 'InteropPermission' failed."

You have written some code, tested it and everything went fine. Now the project has gone live, and all of a sudden, the code fails with the error message from above.
The code is probably executed in another context as when you tested it. For example by another user, or in batch.
The reason for the failure is the security measures that were implemented in Ax 4.0 and up.
What do you need to do? Assign permissions to execute the code (CLR Interop). Like this:

InteropPermission permission = new InteropPermission(InteropKind::ClrInterop);
;
permission.assert();

If your error message is regarding a COM object that you are referencing, you can use this alternative:

InteropPermission permission = new InteropPermission(InteropKind::ComInterop);
;
permission.assert();

You can read more about CAS or Code Access Security over at MSDN.