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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 10.12.2018, 04:50   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
ievgensaxblog: MSDyn365FO. Code to build cross reference data without a full compile.
Источник: https://ievgensaxblog.wordpress.com/...-full-compile/
==============

After 8.1 there is no need to do code upgrade and build standard code supplied by Microsoft or at least we’ve been told so. However, it’s impossible to refresh cross references without building model with Visual Studio tools and we need this because now hotfixes and monthly updates are cumulative and include binaries and X++ code as well, so cross reference data on dev VMs becomes outdated quite quickly.

While MS is working on actual solution, I dug a bit into xppc that compiles X++ code and build cross references and here you are, this code can be used to build cross references for a module without compile, that is way faster!

using Microsoft.Dynamics.AX.Framework.Xlnt.XReference;using Microsoft.Dynamics.AX.Metadata.XppCompiler;using System;class XRefBuilder{ static void Main(string[] args) { try { string moduleName = "ApplicationCommon"; string metaDataPath = @"K:\AosService\PackagesLocalDirectory"; ICrossReferenceProvider xRefProvider = CrossReferenceProviderFactory.CreateSqlCrossReferenceBatchProvider(".", "DYNAMICSXREFDB", moduleName, true, true, new DiagnosticsHandler()); xRefProvider.StartBatch(); new MetadataXRefSweeper( metaDataPath, moduleName, xRefProvider, DateTime.MinValue, new DiagnosticsHandler()).Run(); xRefProvider.CommitBatch(); } catch (AggregateException ae) { ae.Handle(ex => { Console.WriteLine(ex.InnerException != null ? ex.InnerException.Message : ex.Message); return true; }); } }}Note catch section, it was a big surprise for me, but standard code has lots of compile issues, for example, KanbanMultiDelete action menu item has EnumParameter property populated but EnumTypeParameter is not. In 2012 days it was not possible to do this, but now you can literally type anything into EnumParameter without specifying enum and save it. Cross reference builder would try to find that enum and throw an exception saying that cannot find an enum with empty name. That’s why I have that catch section and that’s what xppc does, just skip all these errors and probably log them somewhere.

Another gotcha here is OutOfMemoryException that you can get with ApplicationSuite model, so don’t forget to handle it as well.



Источник: https://ievgensaxblog.wordpress.com/...-full-compile/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
Старый 10.12.2018, 13:46   #2  
trud is offline
trud
Участник
Лучший по профессии 2017
 
1,038 / 1629 (57) ++++++++
Регистрация: 07.06.2003
Записей в блоге: 1
А почему нельзя просто compile запустить? он же в пределах часа по всему работает. или они планируют compile убрать?
Старый 10.12.2018, 21:13   #3  
skuull is offline
skuull
Участник
Most Valuable Professional
Лучший по профессии 2014
 
699 / 752 (27) +++++++
Регистрация: 08.03.2013
Адрес: ХЗ
Так раза в 3 быстрее.
Старый 12.12.2018, 12:19   #4  
skuull is offline
skuull
Участник
Most Valuable Professional
Лучший по профессии 2014
 
699 / 752 (27) +++++++
Регистрация: 08.03.2013
Адрес: ХЗ
Цитата:
Сообщение от skuull Посмотреть сообщение
Так раза в 3 быстрее.
А почему ? Потому что не строит перекрестные ссылки по коду, только по метаданным
Старый 12.12.2018, 12:36   #5  
trud is offline
trud
Участник
Лучший по профессии 2017
 
1,038 / 1629 (57) ++++++++
Регистрация: 07.06.2003
Записей в блоге: 1
Надо в пост картинку добавить
Название: Compiling.png
Просмотров: 162

Размер: 64.5 Кб
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
ievgensaxblog: Advanced cross-reference search. Blog bot DAX Blogs 0 26.11.2017 05:38
patrickmouwen: 1yr with AX7 Data Management – My top 12 learnings Blog bot DAX Blogs 2 12.10.2016 15:14
emeadaxsupport: SEPA affected objects Blog bot DAX Blogs 0 29.11.2013 13:11
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
wiki.dynamicsbook: Changes Made in Navision Attain 3.01B Blog bot Dynamics CRM: Blogs 0 21.08.2008 20:43
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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