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

njhansen
Member Posts: 37
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:
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.
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.
0
Comments
-
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions