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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 05.07.2016, 12:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
Axilicious:Dynamics AX7 Add-ins : Deploying separate assemblies
Источник: http://www.ksaelen.be/wordpresses/dy...te-assemblies/
==============

A small tip today for those creating add-ins for Dynamics AX7. If you are creating an add-in, the template provides you with a project containing a class for you menu add-in.


[Export(typeof(IMainMenu))] public class MainMenuAddIn : MainMenuBase
The other thing present in your project is a post-build script that will copy the target assembly to the extension folder of the Dynamics AX 7 Visual Studio extension. By doing so, your add-in will be picked up and loaded by the Dynamics AX 7 extension.

While creating some extensions, I often use separate projects that result in class libraries that contain logic. But if you do this, by default, your add-in will throw exceptions that the referenced assembly could not be loaded. This is because your assembly also needs to be in the folder containing the Dynamics AX 7 extension.

To solve this, you can change the post-build script to also copy other required assemblies.
Look for the line containing:

SET InstallingAssembly=%1
And add the following line below. (Note that the sample filter MyProject*.dll needs to be replaced with a filter that matches your assemblies that you want to copy)

SET InstallingMyAssembliesFilter=%2MyProject*.dll
A bit further, add the following line behind the xcopy line

call xcopy /q /y %InstallingMyAssembliesFilter% .
That should do it for the script itself. The last thing to do is call it post build.
So in the project properties, add the following in the post-build event command line:

call "$(ProjectDir)\installtovs.bat" "$(TargetPath)" "$(TargetDir)"
Now when you build you solution, you should see the following in your output window:

“Copying “C:\Users\Administrator\Documents\Visual Studio 2015\Projects\MySolution1\MyProject1\bin\Debug\MyAddIn.dll” to Dynamics Addins folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\0ueyjx1c.4xo\AddinExtensions.”

1 File(s) copied
2 File(s) copied

========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========



Источник: http://www.ksaelen.be/wordpresses/dy...te-assemblies/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
NAV Team: Control Add-In dll’s files in Microsoft Dynamics NAV 2015 Blog bot Dynamics CRM: Blogs 0 28.01.2015 13:41
NAV Team: How to: Set up your Microsoft Dynamics NAV installation for Single Sign-on with Office 365 using Windows PowerShell Blog bot Dynamics CRM: Blogs 0 19.12.2013 15:10
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 10 Blog bot Dynamics CRM: Blogs 0 17.08.2012 03:27
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 4 Blog bot Dynamics CRM: Blogs 0 24.09.2011 01:16
Platform updates overview - 3.70.B - NAV2009 R2 Blog bot Dynamics CRM: Blogs 0 07.02.2011 22:06

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 10:54.