Metadata in Failed State

jflynnjflynn Member Posts: 34
edited 2011-04-21 in NAV Three Tier
I was hoping someone could shed some light on this issue. I installed R2 and received a lot of these errors. I installed a hotfix (6.00.32228) over the weekend and received one error today after upgrading. I know recompiling the object that is listed in the metadata error will fix it, but it's like driving a car with a wheel that falls off some times. Has anyone found a more permanent fix? After the hotfix, I put all of the databases in single user mode, unchecked the Enable for Microsoft Dynamics NAV Server, and then rechecked it to perform the recompile.

Here is what I believe is happening.

1. Service Tier starts, object cache is cleared
2. Request for object is passed from the RTC client to the Service Tier
3. If in cache, object is pulled from cache and services request from the cache
4. If not, a c# program is generated from the CSIDE code, compiled to a DLL in a temporary folder (assembly) and moved to the cache

Server 2003 - C:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\assembly

Server 2008 - C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\assembly

5. If this process fails, the DLL is left in the assembly folder and is not moved to the cache
6. Next request comes along and fails because DLL is already in temporary folder and process was not written to handle this situation.
7. Recompiling the object tells the object change listener to flush the cache for this object.
8. Obviously something gets reset and allows DLL to be removed.
9. A possible fix would be to trap the metadata error, and automatically reset the cache, and recompile the object.

Does anyone have a permanent solution?


  • kinekine Member Posts: 12,562
    The problem is that each build could change the way how the assemblies are created from the C/AL, thus you need to recompile the objects each time you apply some different version of NAV to have the correct information the app needs to work with the assemblies.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.