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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 22.09.2015, 19:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
goshoom: Debugging TF Build template for AX
Источник: http://dev.goshoom.net/en/2015/09/de...mplate-for-ax/
==============

I’m preparing a build of a Dynamics AX 2009 environment using Team Foundation Server 2013 and libraries from Dynamics AX Admin Utilities. Unfortunately the build failed with the following error:

Exception Message: Object reference not set to an instance of an object. (type NullReferenceException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) It says that there is a null reference somewhere, but it doesn’t say where, which isn’t very helpful.

I opened the block in my build template which handles exceptions (named If a Compilation Exception Occurred) and added one more action before rethrowing the exception.

Activity: WriteBuildError
Message property: compilationException.ToString()

Just getting a string representation of the exception may not look useful, but it did help. This is the message I got in build output:

System.NullReferenceException: Object reference not set to an instance of an object. at CodeCrib.AX2009.Client.Client..ctor() at CodeCrib.AX2009.TFS.ImportXPO.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state) at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) It looks similar, but it’s much more useful. It tells me that the NullReferenceException occurred inside a constructor of Client class in assembly CodeCrib.AX2009.Client. That’s much more specific.

When reviewing the constructor, I noticed it tries to access a registry key (HKEY_CURRENT_USER\Software\Microsoft\Dynamics\5.0\Setup\Components) to find where AX client is installed. I know that these registry keys don’t always exist and I verified that this was the case with my build service too. I created registry keys by running AX configuration utility, started a new build and voilà – there is no NullReferenceException anymore.



Источник: http://dev.goshoom.net/en/2015/09/de...mplate-for-ax/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
goshoom: Local TF Build + VSO + Dynamics AX Blog bot DAX Blogs 0 12.08.2015 14:11
goshoom: Local TF Build with VSO – Intro Blog bot DAX Blogs 0 30.07.2015 12:11
goshoom: Tips for CIL debugging: Collection classes Blog bot DAX Blogs 0 11.01.2015 18:12
goshoom: Tips for CIL debugging: No variables displayed Blog bot DAX Blogs 0 11.01.2015 18:12
Gareth Tucker: SMS and Fax Integration for Microsoft CRM 2011 Blog bot Dynamics CRM: Blogs 0 29.06.2012 19:12

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

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

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