Dynamics AX
  RSS Feed  LinkedIn  Twitter
Want to turn you're data into a true asset? Ready to break free from the report factory?
Ready to gain true insights that are action focused for truly data informed decisions?
Want to do all of this across mutliple companies, instances of Dynamics and your other investments?
Hillstar Business Intelligence is the answer then! (www.HillstarBI.com)

Hillstar Business Intelligence for Microsoft Dynamics AX and NAV on Mobile, Desktop, Tablet


Let us prove to you how we can take the complexity out of the schema and truly enable users to answer the needed questions to run your business! Visit Hillstar Business Solutions at: www.HillstarBI.com

Monday, August 28, 2006

Dynamics AX 4.0 & COM InterOp

In DAX 4.0 a greater level of security is implemented, in that you have to assert different types of permission classes when performing different functions. If for example the InteropPermission class is not used in conjuction with calls to COM objects you might run into a similar message as below:

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

Basically this is because there was a COM call without first creating an instance of the InteropPermission and then asserting correct security permission in order to interact with the said / given COM calls.

If you are an Admin of a system, then you want run into this, but if you are a normal user then you will. This is a good point to say you always need to preform unit testing as a given process user, vs. in admin mode. With that said, below is an example of how to call and use the InteropPermission:


COM com;
InteropPermission permission = new InteropPermission(InteropKind::ComInterop);
;

permission.assert();
com = new COM(namespace.classname);

So you have to .assert(); before you can work with the COM object. In doing so you then successfully enable the given code to execute properly without security errors. You should always encapsulate your code in try{} catch{} blocks to handle Any errors properly.

Check back for more as we explore File IO security, and preforming both COM and IO work in the same scope of code, and dealing with asserting at different levels.

Find a job at: www.DynamicsAXJobs.com

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home


Copyright 2005-2011, J. Brandon George - All rights Reserved