Error when building/publishing
Any clues as to what causes this error?
[2017-07-20 11:02:11.11] Publishing package to http://localhost:7049/navision_main/dev/apps?tenant=default [2017-07-20 11:02:11.15] Error: The request failed with code 422, reason: Specified part does not exist in the package.
Microsoft (R) AL Compiler version 0.7.11459 Copyright (C) Microsoft Corporation. All rights reserved
[Error - 11:51:03 AM] 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: 'Unexpected value 'SystemOptionType' of type 'Microsoft.Dynamics.Nav.CodeAnalysis.BoundKind''
StackTrace:
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.CodeGenerator.EmitExpression(BoundExpression expr, Boolean suppressTarget, Boolean isStatement) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\CodeGen\CodeGenerator_Expressions.cs:line 91
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.MethodCodeGenerator.EmitAssignmentStatement(BoundAssignmentStatement stmt) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\CodeGen\MethodCodeGenerator_Statements.cs:line 202
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.MethodCodeGenerator.EmitSingleStatement(ArrayBuilder1 statementList, BoundStatement stmt) in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\CodeGen\MethodCodeGenerator_Statements.cs:line 135
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.MethodCodeGenerator.EmitBlock(BoundBlock block) in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\CodeGen\MethodCodeGenerator_Statements.cs:line 32
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.MethodCodeGenerator.EmitScopeRunMethod() in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\CodeGen\MethodCodeGenerator.cs:line 570
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.MethodCodeGenerator.EmitScopeClass() in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\CodeGen\MethodCodeGenerator.cs:line 223
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.MethodCodeGenerator.Generate() in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\CodeGen\MethodCodeGenerator.cs:line 87
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileMethod(MethodSymbol methodSymbol) in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 410
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileMembers(ContainerSymbol containingType) in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 281
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileObject(ObjectTypeSymbol containingType) in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 228
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.<>c__DisplayClass16_0.<CompileObjectAsTask>b__0() in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 210
at Microsoft.Dynamics.Nav.CodeAnalysis.Utilities.UICultureUtilities.<>c__DisplayClass5_0.<WithCurrentUICulture>b__0() in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Utilities\UICultureUtilities.cs:line 151
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.WaitForWorkers() in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 160
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileMethodBodies(Compilation compilation, ModuleBuilder moduleBeingBuiltOpt, Boolean hasDeclarationErrors, DiagnosticBag diagnostics, Predicate1 filterOpt, CancellationToken cancellationToken) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 144
at Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.CompileImpl(ModuleBuilder moduleBuilder, Boolean emittingPdb, DiagnosticBag diagnostics, Predicate1 filterOpt, CancellationToken cancellationToken) in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\Compilation.cs:line 794
at Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.Compile(ModuleBuilder moduleBuilder, Boolean emittingPdb, DiagnosticBag diagnostics, Predicate1 filterOpt, CancellationToken cancellationToken) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\Compilation.cs:line 771
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.RunCore(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 419
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.Run(CompilerTextWriter consoleOutput, CancellationToken cancellationToken) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 299
at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.Extensions.CreatePackageRequestHandler.
It's hard to pin point. In one of the procedures, there is an assignment statement (e.g. x := 3), where the compiler gets confused with something similar to a system option. Would you be able to identify the failing line simply by commenting out the code and pressing Ctrl+Shift+B? That would be tremendously helpful.
You can close the issue. Turns out it was wrong initiation of TextEncoding without setting type..
Could you still please paste the code that caused this error? We failed a little too hard for such case.
Of course.
procedure foo(); var Encoding : TextEncoding; begin Encoding := TextEncoding; // Should be "Encoding := TextEncoding::UTF-8" or // "Encoding := Encoding::UTF-8" // Do something with encoding (e.g. frombase64string) end;
Do you know if it will be possible to set codepage at some point? Like Encoding.getEncoding(1252) in the old environment.
Thank you for the repro! We will fix it so that you get a proper red squiggly.
Regarding the Encoding, did you use the .NET Encoding class before? We are gradually providing replacements for most used .NET functionality, so if you would like us to expose more Encoding functionality, maybe please log a new issue (and also list related methods you need to accomplish your task) and will prioritize it accordingly.