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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 05.12.2014, 19:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,626 / 848 (80) +++++++
Регистрация: 28.10.2006
emeadaxsupport: Unable to import model files generated using Export-AxModel cmdlet, or upload it to LCS for Customization analysis
Источник: http://blogs.msdn.com/b/axsupport/ar...-analysis.aspx
==============

I wanted to share an issue you may face when exporting models using the AX 2012 powershell cmdlets. As per the system requirements, we recommend using Powershell v2.0. However you may have Powershell v3 and above installed on your system (like Windows Server 2012 R2), and this can cause the following issues:



Issue 1:

Unable to import models using AXUTIL.EXE, where the models were created using Powershell cmdlet Export-AxModel.

To demonstrate the issue create a custom model file, in this example we refer to a model called “Demo Model”



(a)
Example, run the AX Management Shell and then run the following command to export a custom model called ‘Demo model’

Export-AXModel -model "DEMO MODEL" -file c:\temp\demo1.axmodel



(b)
Run an elevated cmd prompt and import demo1.axmodel using axutil.exe:

axutil import /file:c:\temp\demo1.axmodel



We get an error:

ERROR: Could not load file or assembly 'C:\TEMP\demo1.axmodel' or one of its dependencies. This assembly is
built by a runtime newer than the currently loaded runtime and cannot be loaded.



(However importing the same model using Install-AXModel cmdlet works fine).



(c)
Or if you import the model in to your LCS Project (https://lcs.dynamics.com) under the "Customization analysis" tool, you will get an error as follows:

Only models exported with AxUtil version 6.3.164.2431 or lower can be uploaded to this project





Issue 2:

Also notice that the same model exported by powershell cmdlet is a different file size, compared to it being exported by axutil.exe



(a)
e.g. Export the ‘Demo Model’ using axutil.exe

axutil export /model:"DEMO MODEL" /file:c:\temp\demo2.axmodel



(b)
Now compare file sizes of demo1.axmodel and demo2.axmodel, and notice that demo1.axmodel file is
slightly smaller.





Cause:

Powershell v3 and above uses a different Microsoft .NET Framework build then v2.





SOLUTION:

This issue can be resolved by enforcing the AX Management Shell to use Powershell Version 2 framework instead as follows:



(1)
Secondary mouse-click on the “Microsoft Dynamics AX Management Shell” icon in “Administrative tools” and select properties.



(2)
By default it will have the following target cmdline (or something similar):

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy RemoteSigned -NoExit & 'C:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities\Microsoft.Dynamics.ManagementUtilities.ps1'



(3)
Change the target cmd line on your system by adding one more argument: -Version 2 as follows:



C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Version 2 -ExecutionPolicy RemoteSigned -NoExit & 'C:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities\Microsoft.Dynamics.ManagementUtilities.ps1'



Now you should be able to create the correct model file format when running the Export-AXModel cmdlet in the “Microsoft Dynamics AX Management Shell”.




Источник: http://blogs.msdn.com/b/axsupport/ar...-analysis.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: Importing a General Journal using Data Import/Export Framework AX 2012 Blog bot DAX Blogs 0 17.07.2014 20:12
kurthatlevik: Import/Export: Reinventing the wheel Blog bot DAX Blogs 0 27.12.2013 18:11
axsa: Microsoft Dynamics AX 2012 Data Import/Export Framework standalone version for AX 2012 R2 without installing full CU7 Blog bot DAX Blogs 0 04.12.2013 04:13
emeadaxsupport: Unable to deploy AX 2009 Enterprise Portal on SharePoint 2010 even after patching setup files with hotfix 2278963 Blog bot DAX Blogs 0 08.12.2010 03:14
emeadaxsupport: Unable to install Dynamics AX 2009 Analysis extensions when the default SQL Server Analysis Server collation is set to Turkish_CI_AS or Turkish_CS_AS Blog bot DAX Blogs 0 22.09.2009 04:06

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

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

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