Invalid Header error message when importing XPO using command line

Hi,

I have this exported XPO-file that imports perfectly when using the import tool inside Ax 4. It contains a simple class and a simple method, just for testing purpouses.

I try to import it using command line:

C:>ax32 -regimport=c:\temp\SharedProject_x.xpo

Ax starts and then i get the following error message inside AX:


Registry access error
Import file not in proper format - invalid header.

The xpo file looks like this:

-----Code starts here----

Exportfile for AOT version 1.0 or later
Formatversion: 1
***Element: CLS
; Microsoft Dynamics Class: MyClass unloaded
; --------------------------------------------------------------------------------
  CLSVERSION 1
  
  CLASS #MyClass
    PROPERTIES
      Name                #MyClass
      Extends             #
      RunOn               #Called from
    ENDPROPERTIES
    
    METHODS
      Version: 3
      SOURCE #MyMetod
        #display str MyMetod()
        #{
        #
        #    return "Hello";
        #}
      ENDSOURCE
      SOURCE #classDeclaration
        #class MyClass
        #{
        #}
      ENDSOURCE
    ENDMETHODS
  ENDCLASS
***Element: VIE
; Microsoft Dynamics View : MyVy unloaded
; --------------------------------------------------------------------------------
  TABLEVERSION 1
  
  VIEW #MyVy
    PROPERTIES
      Name                #MyVy
      SaveDataPerCompany  #Yes
    ENDPROPERTIES
    
    QUERY #Metadata
      PROPERTIES
        Name                #Metadata
        Version             #2
        NextUniqueId        #1001
      ENDPROPERTIES
      
      BLOCKS
        BLOCK #Address
          PROPERTIES
            Name                #Address
            Table               #Address
            UniqueId            #1000
          ENDPROPERTIES
          
          FIELDLIST
            PROPERTIES
            ENDPROPERTIES
            
          ENDFIELDLIST
          LINES
          ENDLINES
          BLOCKS
          ENDBLOCKS
        ENDBLOCK
      ENDBLOCKS
    ENDQUERY
    
    FIELDS
    ENDFIELDS
    GROUPS
    ENDGROUPS
    
  ENDVIEW
  
***Element: PRN
; Microsoft Dynamics Project : MyProjekt unloaded
; --------------------------------------------------------------------------------
  PROJECTVERSION 2
  
  PROJECT #MyProjekt
   SHARED
  PROPERTIES
    Name                #MyProjekt
  ENDPROPERTIES
  
    GROUP #Classes
      PROPERTIES
        Name                #Classes
        ProjectGroupType    #Classes
        GroupMask           #
        PreventEditProperties #No
      ENDPROPERTIES
      
      BEGINNODE
        FILETYPE 0
        UTILTYPE 45
        UTILOBJECTID 50053
        NODETYPE 329
        NAME #MyClass
      ENDNODE
      ENDGROUP
      
    GROUP #View
      PROPERTIES
        Name                #View
        ProjectGroupType    #Views
        GroupMask           #
        PreventEditProperties #No
      ENDPROPERTIES
      
      BEGINNODE
        FILETYPE 0
        UTILTYPE 44
        UTILOBJECTID 50066
        NODETYPE 243
        NAME #MyVy
      ENDNODE
      ENDGROUP
      
  ENDPROJECT
  
***Element: END

—Code Ends Here---------------

Any Ideas?
/R

Problem Solved!

I tried a different approach using an Autorun xml-file

The Autorun-xml contains the command(s) that should be executed :

<?xml version="1.0" encoding="utf-8"?>

ax32.exe -StartupCmd=AutoRun_c:\temp\AxAutoRun.xml

Hi,

I have tried as suggested by you. But my AX crash while starting.

I am imporing a file which is already EXIST in AOT.

Any idea?