Error when debugging extension
Hello, I am developing an extension for business central, and after making several changes and debugging several times, I have given the following error message, I do not know the reason. Can you indicate what happens? Thank you.
The Visual Code version is 1.24.1
[Error - 18:09:39] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible.
Processing of message 'al/createPackage' failed with error: 'Referencia a objeto no establecida como instancia de un objeto.'
StackTrace:
en Microsoft.Dynamics.Nav.CodeAnalysis.PropertyExpressionEmitterHelper.GetBoundOptionValueOrdinal(BoundEqualsPropertyExpression expression) en C:\Agent_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\PropertyExpressionEmitterHelper.cs:línea 149
en Microsoft.Dynamics.Nav.CodeAnalysis.PropertyExpressionEmitterHelper.GetConstConditionValue(BoundEqualsPropertyExpression expression) en C:\Agent_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\PropertyExpressionEmitterHelper.cs:línea 241
en Microsoft.Dynamics.Nav.CodeAnalysis.PropertyExpressionEmitterHelper.WriteFilterAttributes(XmlWriter writer, BoundEqualsPropertyExpression equalsExpression, String filterValueAttribute, String filterTypeAttribute, String filterGroup, Boolean isCondition) en C:\Agent_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\PropertyExpressionEmitterHelper.cs:línea 294
en Microsoft.Dynamics.Nav.CodeAnalysis.PropertyExpressionEmitterHelper.<>c__DisplayClass1_1.1.TryUseSpecialPropertyValueMetadataEmitter(XmlWriter xmlWriter, PropertySymbol property) en C:\Agent\_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\TableBaseMetadataEmitter.cs:línea 127
en Microsoft.Dynamics.Nav.CodeAnalysis.Emit.ObjectMetadataEmitter.WritePropertyValueMetadata(XmlWriter xmlWriter, PropertySymbol property) en C:\Agent\_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\ObjectMetadataEmitter.cs:línea 50
en Microsoft.Dynamics.Nav.CodeAnalysis.Emit.ObjectMetadataEmitHelper.WriteElementProperties(XmlWriter xmlWriter, IEnumerable1 properties, Action2 writePropertyMetadata) en C:\Agent\_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\ObjectMetadataEmitHelper.cs:línea 58
en Microsoft.Dynamics.Nav.CodeAnalysis.Emit.TableBaseMetadataEmitter1.<>c__DisplayClass4_0.1.EmitMetadata(Action1 content) en C:\Agent_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\GenericObjectMetadataEmitter.cs:línea 36
en Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.EmitMetadata(ObjectTypeSymbol containingType) en C:\Agent_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:línea 251
en Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileObject(ObjectTypeSymbol containingType) en C:\Agent_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:línea 234
en Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.<>c__DisplayClass16_0.1 filterOpt, CancellationToken cancellationToken) en C:\Agent\_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:línea 145
en Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.CompileImpl(ModuleBuilder moduleBuilder, Boolean emittingPdb, DiagnosticBag diagnostics, Predicate1 filterOpt, CancellationToken cancellationToken) en C:\Agent_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\Compilation.cs:línea 816
en Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.Compile(ModuleBuilder moduleBuilder, Boolean emittingPdb, DiagnosticBag diagnostics, Predicate`1 filterOpt, CancellationToken cancellationToken) en C:\Agent_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\Compilation.cs:línea 791
en Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.PackageTheModule(Compilation compilation, CompilerTextWriter consoleOutput, CancellationToken cancellationToken, ErrorLogger errorLogger, AnalyzerDriver analyzerDriver) en C:\Agent_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:línea 551
en Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.RunCore(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken) en C:\Agent_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:línea 414
en Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.Run(CompilerTextWriter consoleOutput, CancellationToken cancellationToken) en C:\Agent_work\46\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:línea 313
en Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.Extensions.CreatePackageRequestHandler.
I have already seen what happens, in the field "Source subtype" of table 336 I had assigned as CONST and that causes the error to occur, when changing it to FILTER it no longer gives the error. Thank you. This is the error CalcFormula = Sum("Reservation Entry"."Quantity (Base)" WHERE ("Source Type"=CONST(5741), "Source Subtype"=FILTER(0), "Source ID"=FIELD("Document No."), "Source Ref. No."=FIELD("Line No."))); Corrected CalcFormula = Sum("Reservation Entry"."Quantity (Base)" WHERE ("Source Type"=CONST(5741), "Source Subtype"=FILTER(0), "Source ID"=FIELD("Document No."), "Source Ref. No."=FIELD("Line No.")));
Happened for me to. You have closed the issue, but are we sure that this issue has been fixed? Using const instead of filter, should not give a compiler run time error.
Did Microsoft register this as a bug?
Got similar error for this LOOKUP, with build 0.12.17720 against Azure SQL but passed for my On-premise local installation with build 0.12.17091: tableextension 50100 AIL_ItemLedgerEntry extends "Item Ledger Entry" ... FieldClass = FlowField; CalcFormula = lookup(Customer.name where("no." = field("source no.")));
[Error - 12:13:45 PM] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible.
Processing of message 'textDocument/hover' failed with error: 'Object reference not set to an instance of an object.'
StackTrace:
at Microsoft.Dynamics.Nav.CodeAnalysis.CalculationFormulaBindingValidatorHelper.ValidateCalculationFormulaSourceFieldType(SyntaxKind operatorKind, BoundFieldAccess fieldAccess, DiagnosticBag diagnostics) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\CalculationFormulaBindingValidatorHelper.cs:line 58
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindCalculationFormulaPropertyValue(CalculationFormulaPropertyValueSyntax calculationFormula, PropertyTypeInfo info, DiagnosticBag diagnostics) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Properties.cs:line 1094
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindProperty(PropertySyntax syntax, DiagnosticBag diagnostics) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Properties.cs:line 61
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SourcePropertySymbol.LazyGetProperty() in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Symbols\Source\SourcePropertySymbol.cs:line 177
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SourcePropertySymbol.get_Property() in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Symbols\Source\SourcePropertySymbol.cs:line 115
at Microsoft.Dynamics.Nav.CodeAnalysis.PropertySymbol.GetPropertyTypeInfo() in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Symbols\PropertySymbol.cs:line 71
at Microsoft.Dynamics.Nav.CodeAnalysis.SymbolDisplayVisitor.VisitProperty(PropertySymbol symbol) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\SymbolDisplay\SymbolDisplayVisitor.cs:line 554
at Microsoft.Dynamics.Nav.CodeAnalysis.SymbolDisplay.ToDisplayParts(ISymbol symbol, SemanticModel semanticModelOpt, Int32 positionOpt, SymbolDisplayFormat format, Boolean minimal) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\SymbolDisplay\SymbolDisplay.cs:line 106
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbol.ToDisplayString(SymbolDisplayFormat format) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Symbols\Symbol.cs:line 503
at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.HoverRequestHandler.CreateContent(ISymbol symbol) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\HoverRequestHandler.cs:line 66
at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.HoverRequestHandler.
[Error - 12:22:35 PM] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible.
Object reference not set to an instance of an object.
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesService.FindReferencedSymbolsAsync(Document document, Int32 position, CancellationToken cancellationToken) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesService.cs:line 25
at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.CodeLensResolveRequestHandler.
Can you please try this on a newer AL version. I have no repro on this on the latest version
Yes, it Works With "Compiler version 0.12.28462". Is there any issues to mix the VSIX build With NAV server build? I only updated vsc to cu8, but leaved the nav-platform at cu6.
Yes it is. VSIX versions work (safely) with their corespondent server versions. That said you maybe lucky, but it is not advised. From the "July" AL extension (13.xxxx) version you would actually get compiler errors if there is a version mismatch between the server and what the Al extension would support.