web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

I cannot import a model with ModelUtil

(0) ShareShare
ReportReport
Posted on by

Morning, 

I have an export of a model that I prepared yesterday. The epxort was made by the command line 

ModelUtil.exe -export -metadatastorepath=[path of the metadata store] -modelname=[name of the model to export] -outputpath=[path of the folder where the model file should be saved]

When I wanted to import that model later on, this is what I get :

C:\AOSService\PackagesLocalDirectory\bin>ModelUtil.exe -import -metadatastorepath=C:\AOSService\PackagesLocalDirectory -file="C:\Users\Userdev5\Desktop\ExportModels07-10-2020\Processus ABS.axmodel"
Object reference not set to an instance of an object.

And in my Packages folder: I noticed that he had created a new Folder with the name of my Model and under that, he had put the XML files.

pastedimage1602147509459v1.png

Any help would make me greatful. 

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Naycene,

    Was this model already on this Dev server before? Since you mentioned that you got an error while importing the model earlier.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You can only import a model if it doesn't already exist in the system.

    Did it already exist before you imported it?

    Anyway, you can delete the folder from PackagesLocalDirectory and try to import again.

  • Community Member Profile Picture
    on at

    Thank you for your response.

    yes of course, I have already deleted the import with the delete command. I tried also by deleting the folder from the PackagesLocalDirectory .

    Always the same error when importing.

  • nmaenpaa Profile Picture
    101,160 Moderator on at

    - What is the D365 version of the system where the model was exported from?

    - What is the D365 version of the system where you are importing the model?

  • Community Member Profile Picture
    on at

    It was exported/imported from the same system (same VM) with the version 10.0.9.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    I have never experienced this issue. Since it's a local VHD, have you ever installed Microsoft D365 updates on it? If yes, did you remember to update all D365 components? If you just install the update with default settings, it will not update all components.

    Anyway, whenever you have strange issues in your dev VM, my suggestion is to deploy a new VM. This way you will get a clean start and don't need to waste your time fighting with problems.

    Have you tried to import this model to another VM? This way you can verify the model file, and not be distracted by possible problems in your VM.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Naycene,

    Please try the following and see if you still get the same error.

    1. Delete the model from the VM. Ensure that the model folder is deleted from Packages local directory.

    2. Rename the axmodel file to - "Processus_ABS.axmodel"

    3. Try running the import again using this command - C:\AOSService\PackagesLocalDirectory\bin>ModelUtil.exe -import -metadatastorepath=C:\AOSService\PackagesLocalDirectory -file=C:\Users\Userdev5\Desktop\ExportModels07-10-2020\Processus_ABS.axmodel.

  • Community Member Profile Picture
    on at

    Hi Naycene

    1. Stop the IIS AOSService first and then delete the existing model.

    2. After deleting the model, delete the respective package folder present in packages Folder directory.  

    3.once it is done, Start the IIS AOSService. Go to visual studio and under D365 menu --> Model Management --> RefreshModels

    4. Now synchronize the Database. Once it is done.

    5. Now Stop the IIS AOSService and try importing the model again.

    Let me know if it works for you.

  • Community Member Profile Picture
    on at

    Still the same error :(

  • Community Member Profile Picture
    on at

    Is it necessary to build the model + synchronize the database before making an export?

    Im thinking it's probably what is causing the problem

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans