- Wenn euch folgender Laufzeitfehler begegnet:error CS0030: Cannot convert type 'int' to 'Microsoft.Dynamics.Nav.Runtime.NavOption'
AuĂźerdem im Eventlog:Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLMetadataCompileErrorException
Compilation of assembly 'xxx.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: xxx : error CS0030: Cannot convert type 'int' to 'Microsoft.Dynamics.Nav.Runtime.NavOption' - oder sich der NAV-Dienst mit folgendem Event Log nicht mehr starten lässt: The Microsoft Dynamics NAV Server instance could not start because of an event publisher or subscriber error in relation to Codeunit xxx. Try to recompile the object in the development environment to ensure the correct metadata is used.
Compilation of assembly 'xxx.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: xxx : error CS0030: Cannot convert type 'int' to 'Microsoft.Dynamics.Nav.Runtime.NavOption'
- Code: Alles auswählen
OptionVariable += 1;
Der unter 2. erwähnte Eventlog enthält irreführende Informationen: Die genannte Codeunit hat kein Problem mit Subscribern oder Publishern. Sie hat enthält zwar Subscriber oder Publisher, aber die unerlaubte Zuweisung += 1 kann irgendwo anders stehen. Immerhin ist die Codeunit-ID richtig, und auch mit Hilfe der Error details findet man die ursächliche Codezeile.
Kompilieren allein der Objekte bringt ĂĽbrigens nichts, schon gar nicht einen Fehler. Es ist ein reiner Laufzeitfehler.
Workaround:
- Code: Alles auswählen
OptionVariable := OptionVariable + 1;
Nachtrag: Korrigiert mit NAV 2017 CU10