NAV RTC Failing with NavTriggerMethodScope error

I have just had this issue. I am testing RTC in a 3-tier architecture and have upgraded db and server (6.0.29626.0) and have installed 2009 SP1 RTC (6.0.29626.0) following the link

http://msdn.microsoft.com/en-us/library/dd301254.aspx

I have already recompiled all objects after install, restarted the NAV server service on mid-tier box and restarted the box itself but no joy…

When I start the RTC cleint, the message pops up once with regards to table 140 (Licence Management) and the NavTriggerMethodScope error is displayed. The login box is displayed after I press ok and tonce the details are in, the same message pops up once I try to login.

I also get the error “Metadata for object of type Table with id 140 is in a failed state.” above the same error message at the start.

Any help much appreciated
michaellee

Just bumping this up. Can no NAV guru’s help me with this?

Thanks,

Mike

Uninstall all the components (RTC,Classic Client, Server and Service). Go to Sql server 2005 and delete the database “demo nav database(6.0)”(I am not sure of the Database name).

Then install all the components using autorun.exe. Dont install the required components separately.

Now your RTC will be opened without problem.

Hi Karthik,

I have checked my SQL 2008 R2 server but the db you mentioned is not there…

Also, advising me to uninstall everything seems a bit drastic? The RTC is working as it connects with NAV Server, NAV Server is working as it is connecting with the RTC and establishes a connection with the SQL Server and Classic client is working as it connects directly to teh SQL server…?

Thanks,

Mike

Hi Mike,

Actually I dont have that much experience in RTC. But once I struggle to open RTC and it was not opened. After that I did the thing that I mentioned before, it was opened properly.

I had exactly the same error ‘The type or namespace name could not be found NavTriggerMethodScope’ yesterday but mine was as a result of using a slightly newer build of the NAV2009SP1 classic client (A certain someone installed a patch on development server without telling me!). All the RTC pages still ran fine until I recompiled them with the slightly newer classic client. From that point on any pages I had compiled or any parts used in a page failed when accessed thought RTC with this error (It was like the code on OnAfterGetRecord on the header tables could not executed)

My understanding, and Lars if you happen on this post can you please elaborate how RTC works…

When you compile a page in the classic client it writes information into T2000000071 [“Object Metadata”]. When you access a page using the RTC or in my instance my Web Service using URL it generates C# code based on this Object Metadata and compiles it. If the Version of the server is different to the client that was used to compile the object you could get this error.

Upgrading the server layer to same build and again using classic client to compile Page, Part pages and tables used in my page fixed it! Alternatively using the original classic client to re-compile the object also fixed it!

Yes a total re-install will get round this but in my instalance this would have been far to time consuming.

It would have been nice to receive a friendly error message like ‘Build version number difference between client & middle tier’! Mike, not sure if this helps in your instance but this fixed my issue!

Thanks for the suggestion Scott and I have just checked my NAV Classic Client version and it is indeed different to the RTC and Server version! (6.00.30929). I will check with my vendor for the latest updates… Why they don’t even know this is worrying…

EDIT - Just checked the NAV SP1 CD provided and checked the versions on each of the .exe and they do differ… Thanks Microsoft… Can anyone confirm the latest file versions for all three .exe? Classic/RTC/Server?

Glad it helped!

No way I want to restore 70GB SQL backup and re-install/rebuild it all from scratch!! Build versions seem very fluid. It will be interesting to see how many builds are out there keep us posted!

Best to choose a build an stick with it till have issues, makes it even more interesting when you support a number of clients on different versions of SQL on different versions of Navision and now on different builds!!!

SOLVED!

The issue IS to do with build numbers and they need to be exactly the same for Classic Client (for recompile), NAV Server and RTC. I also updated the build on NAS just to be sure.

Also, to answer my own question, the latest build number is 6.0.31671. This was released on 15/10/2010.

I hope this information helps any others who have this issue as trying to find an answer to this issue is not really well documented on the web.

Mike

Just a follow up.

Scott you are almost 100% on your assumption of how things work. Here is a recap with slight change:

  1. When you compile an object in Classic Client from the object designer, internally after the AL compilation completes (without error) then the generation of C# and XML metadata for consumption on the NAV Server, is performed by c/side and this is stored for the object in the Object Metadata table. This generation is also done in tasks of the Classic Client other than an explicit compile. It is not done if you have a designer open and do F11 there, it is only done on saved objects. If an object is saved in an uncompiled state (or deleted), the entry is removed from the Object Metadata table - on the NAV Server there would then be an error indicating that the object cannot be found.

  2. At runtime, the NAV Server loads the C# and/or metadata from this table for an object being referenced. The C# is compiled at that time into an assembly and loaded into the NAV Server process for execution. It is at this point that a problem such as this can occur, when the C# that was generated based on one version of NAV does not match types in the binaries on the NAV Server of a different version of NAV. In this case the NavTriggerMethodScope type was introduced as part of the code generation of the c/side version, but this type was not part of the binaries of the NAV Server version, and could not be resovled. (The issue is more complex: the XML is handled a different way; caching of the assemblies and XML occurs; and a RAD mechanism allows old objects to be replaced as changes are made to objects in c/side, but this is the basic process.)

Unfortunately this problem occured unintentionally in the 6.0 SP1 Hotfix releases after a certain build, which means that both c/side and the NAV Server binaries need to be in sync, and also that all NAV objects needing to be exected on the NAV Server (you can generalize this to all objects) need to be re-compiled. For major releases, re-compiling all application objects due to extensions and changes to C# because of new features, is nearly always necessary, but is not the intended behaviour for point releases and hotfixes, and this was an unfortunate error.

The ensuing message about “metadata in a failed state”, which would continue to be shown therafter until a server restart, has been removed from NAV. This allows the original problem to be solved (in this case, recompiling objects, in other cases perhaps permission changes to NAV objects, in the security system) and the task retried without the need for a server restart.

In future a more friendly message will indeed be displayed, instead of the long C# compiler error, when the code generation version and NAV version do not match.