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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 19.02.2014, 14:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Axilicious:The Registry.CurrentUser impediment
Источник: http://www.ksaelen.be/wordpresses/dy...er-impediment/
==============

Today I was working on creating a build process template for AX2012. I will not go into the details about the build process template and the custom activities as these activities will be covered by Joris De Gruyter later on. But still, I wanted to show you guys a nasty little problem I was experiencing yesterday.

The build process threw an exception : ” Object reference not set to an instance of an object

So, this was of course a null reference, but after some investigation ( by using primitive logging because this was running in the agent process ) it turned out to be located in this code:

public static string GetInstallDir32(){ RegistryKey componentsKey = Registry.CurrentUser.OpenSubKey(regKey, false); String installDir32 = componentsKey.GetValue("InstallDir32", null) as String; return System.Environment.ExpandEnvironmentVariables(installDir32);}
It turned out to be the Registry.CurrentUser property that returned null. And then it struck me, the agent ran under a service account s_tfs_build and since this account was never used to log on interactively, the profile of this user was not loaded up to that point.

The simple solution was to log on to the system with the service account so that the user profile and registry hive were loaded. From then on, the Registry.CurrentUser property was properly filled.




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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crminthefield: CRM 2011 Platform Tracing – Registry vs. Windows PowerShell Blog bot Dynamics CRM: Blogs 0 16.10.2013 03:12
Axilicious:Running AX2012 R2 locally on Windows 2012 Server booted directly from VHD Blog bot DAX Blogs 0 16.04.2013 08:13
Naresh: Read and Alter registry settings in Axapta Blog bot DAX Blogs 0 22.12.2010 08:11
East Ocean - Technical: Configuration registry key is invalid Blog bot Dynamics CRM: Blogs 0 22.09.2010 23:05
axaptapedia: Registry client name Blog bot DAX Blogs 0 27.05.2009 09:05

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

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

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