AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.10.2006, 16:40   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Dynamics AX: Dynamics AX 4.0 & COM InterOp
Источник: http://dynamics-ax.blogspot.com/2006...m-interop.html
==============
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


==============
Источник: http://dynamics-ax.blogspot.com/2006...m-interop.html
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Arijit Basu: Reporting & BI in AX: An Overview [Level 100] Blog bot DAX Blogs 0 07.01.2008 16:01
Inside Dynamics AX 4.0: Usage Scenarios Blog bot DAX Blogs 0 04.10.2007 05:15
Сергей Герасимов: Что нового в Microsoft Dynamics AX 4.0 Blog bot DAX Blogs 0 16.01.2007 11:00
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 00:51.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.