locked
Internal Error: Operation is not valid due to the current state of the object.(System.InvalidOperationException) at MX

    Question

  • Look at this:


    E:\Projects\intellidesign.omg.mof>mx /i:mof.mx /i:themofm.mx /db:Repository  /f
    Microsoft (R) "Codename M" Command-line Utility version 1.0.0925.0
    Copyright (C) Microsoft Corporation. All rights reserved.


    Internal Error: Operation is not valid due to the current state of the object.(System.InvalidOperationException)
       at Microsoft.TSQL10.SyntaxTree.InsertStatement.VerifyDataSourceIsValid()
       at Microsoft.TSQL10.SyntaxTree.InsertStatement.WriteCreateScript(TextWriter writer, String prefix)
       at Microsoft.TSQL10.CreateScript.Write(TextWriter writer, IEnumerable`1 targets)
       at Microsoft.TSQL10.CreateScript.Write(TextWriter writer, IChangeUnit target)
       at Microsoft.M.Loader.SqlGeneration.DeltaScriptGenerator.Generate(TextWriter writer)
       at Microsoft.M.Loader.SqlGeneration.DeltaScriptGenerator.Generate(Database current, Database target, Boolean force, B
    oolean useMapping, ErrorReporter errorReporter, TextWriter writer)
       at Microsoft.M.Loader.SqlLoaderServices.WriteScript(Catalog catalog, IPackageDescription packageToInstall, Boolean fo
    rce)
       at Microsoft.M.Loader.SqlLoaderServices.Install(Catalog catalog, IPackageDescription packageToInstall, SqlLoaderOptio
    ns options)
       at Microsoft.M.Loader.SqlLoaderServices.Install(IEnumerable`1 imageFiles, IEnumerable`1 imagesToInstall, SqlLoaderOpt
    ions options)
       at Microsoft.M.Tools.MX.InstallImagesByName(IEnumerable`1 files, IEnumerable`1 imagesToInstall)
       at Microsoft.M.Tools.MX.InstallImages()
       at Microsoft.M.Tools.MX.PerformAction()
       at Microsoft.M.Tools.MX.Run(String[] args)

    E:\Projects\intellidesign.omg.mof>

    Does that make sense to anybody? Something wrong with Enums?

    The M file:
     
    // (c) IntelliSign Ltd. module omg.mof { theModelElement { ModelElement{ name = "ModelElement", .theNamespace {ModelElement{ super=theModelElement.ModelElement, .theGeneralizableElement {ModelElement{ super=theNamespace.ModelElement, //supertypes = {}, .theClassifier {ModelElement{ super=theGeneralizableElement.ModelElement, .theClass {ModelElement{ super=theClassifier.ModelElement }} }} }} }} }} }

    And furthermore of interest is, that if I compile like this, it works, creating the mx file:


    E:\Projects\intellidesign.omg.mof>m /p:image /t:Repository /r:mof.mx themofm1.m
    Microsoft (R) "Codename M" Compiler version 1.0.0925.0
    Copyright (C) Microsoft Corporation. All rights reserved.



    E:\Projects\intellidesign.omg.mof>

    But if I compile like this, it gives an error similar to the one already mentioned above:


    E:\Projects\intellidesign.omg.mof>m /p:image /t:Repository /r:mof.mx themofm1.m
    Microsoft (R) "Codename M" Compiler version 1.0.0925.0
    Copyright (C) Microsoft Corporation. All rights reserved.



    E:\Projects\intellidesign.omg.mof>



    Tuesday, January 06, 2009 9:43 PM

Answers

  • Frank,

    Thanks for the feedback!

    I'm trying to reproduce your scenario so that I can file a bug internally at MSFT.
    Can you post the following information?
    1. The source of all M files you're compiling into mof.mx and themofm.mx
      (I see themofm1.m in your post, which you compile into mof.mx, but I can't find the m file(s) you're compiling into themofm.mx)
    2. The commands you're running to compile these files (parameters to m.exe)
    3. Information about existing data already loaded into your Repository database.
    Also, I can't tell the difference between your two m.exe commands, can you check these? If there are multiple scenarios/errors here, I want to make sure we get all of them tracked and fixed.

    Thanks,

    David
    Thursday, January 08, 2009 5:03 PM