Options

Recompile causes "Metadata for object..is in a failed state"

njhansennjhansen Member Posts: 36
edited 2015-02-23 in NAV Three Tier
OK, this problem seems to be the mirror image of http://www.mibuso.com/forum/viewtopic.php?t=37056.

Web services mysteriously started giving the error below. I found the thread above, which advised a full recompile, but that did not help. Then I remembered that I had just recently done a full recompile to ensure that some field changes had not caused any problems. So, I pulled the object (Code unit 8700) from another server as a FOB, and imported it, and all is well.

If I recompile the object, it gives no error (not even warnings). But the behavior remains the same, the error below appears. Restarting the service does not help.

Import the same FOB again, and all is well until the next recompile.

How is this possible? The code obviously has not changed, so I don't even know where to begin debugging this, and I certainly don't want to be in a position in which I cannot compile certain objects lest the web services stop working.


Full error received:
Metadata for object of type CodeUnit with id 8700 is in a failed state. This is caused by a previous exception:

Compilation of assembly 'C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer$test\assembly\Codeunit8700.dll' failed. This can be caused by differences between binaries in your installation or your database. Ensure that all installation components are consistent and up to date. Error details: c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer$test\source\Codeunit\Codeunit8700.cs(350,36) : error CS1502: The best overloaded method match for 'Microsoft.Dynamics.Nav.Runtime.NavAutomation.NavAutomation(Microsoft.Dynamics.Nav.Runtime.ITreeObject, Microsoft.Dynamics.Nav.Runtime.NavAutomation.ComponentType, string)' has some invalid arguments
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer$test\source\Codeunit\Codeunit8700.cs(350,63) : error CS1503: Argument '2': cannot convert from 'object' to 'Microsoft.Dynamics.Nav.Runtime.NavAutomation.ComponentType'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer$test\source\Codeunit\Codeunit8700.cs(350,78) : error CS1503: Argument '3': cannot convert from 'bool' to 'string'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer$test\source\Codeunit\Codeunit8700.cs(377,40) : error CS1502: The best overloaded method match for 'Microsoft.Dynamics.Nav.Runtime.NavAutomation.NavAutomation(Microsoft.Dynamics.Nav.Runtime.ITreeObject, Microsoft.Dynamics.Nav.Runtime.NavAutomation.ComponentType, string)' has some invalid arguments
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer$test\source\Codeunit\Codeunit8700.cs(377,67) : error CS1503: Argument '2': cannot convert from 'object' to 'Microsoft.Dynamics.Nav.Runtime.NavAutomation.ComponentType'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer$test\source\Codeunit\Codeunit8700.cs(377,86) : error CS1503: Argument '3': cannot convert from 'bool' to 'string'

As an aside, I can look inside the temp .cs file that NAV is generating, and see that the arguments match what the compiler says they are (and should not be), but I don't know how NAV decides to generate these files.

Comments

  • Options
    vremeni4vremeni4 Member Posts: 323
    Hi,

    You did not say what version of NAV you use but if I look at the error message it says "..Microsoft Dynamics NAV\60\" so I will assume this is NAV 2009 R2.

    I got similar error message when I imported a text objects from higher version e.g. NAV 2013 or NAV 2009 R2 with higher build number, into NAV 2009 R2. (with a low build number)
    There are some tags in e.g. NAV 2013 which are causing these issues in NAV 2009 R2.

    Another option would be to
    1. delete the record for the codeunit 8700 form the table "Object Metadata".
    2. compile all objects.
    3. import codeunit 8700 as a FOB.

    I hope this helps.
    Thanks.
Sign In or Register to comment.