AL
AL copied to clipboard
Compiling app using NextMajor version is failing with AL compiler error
Please include the following with each issue:
1. Describe the bug When trying to compile the app as a SaaS solution in the NextMajor container, I get a AL compiler error
Example artifact version $artifactUrl = Get-BCArtifactUrl -type Sandbox -country w1 -version 21.0.40263.0 -storageAccount bcinsider -select All -sasToken $sasToken
2. To Reproduce Steps to reproduce the behavior:
- Go to '...'
Compile-AppInBcContainer -containerName bc `
-appProjectFolder $projectFolder `
-appOutputFolder $outputFolder `
-credential $credential
3. Expected behavior For the app to compile successfully with warnings
4. Actual behavior
Compiling...
.\alc.exe /project:"C:\Agents\nav-app\app" /packagecachepath:"C:\Agents\nav-app\app\.alpackages" /out:"C:\Agents\nav-app\app\Company_N
avApp_1.2.3.4.app" /assemblyprobingpaths:"C:\Program Files\Microsoft Dynamics NAV\210\Service","C:\Program Files (x86)\Open XML SDK\V2.5\lib","c:\Windows\Microsoft.NET\Assembly","C:\Te
st Assemblies\Mock Assemblies"
Microsoft (R) AL Compiler version 10.0.9.46544
Copyright (C) Microsoft Corporation. All rights reserved
Compilation started for project 'NavApp' containing '8314' files at '11:46:30.128'.
Compilation ended at '11:47:01.929'.
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.IsPropertyDependencySatisifiedWithDefaultValue(PropertyTypeInfo propertyInfo, DependentProperty dependentProperty
) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 450
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.IsPropertyDependencySatisfied(Symbol symbolWithDependentProperties, DependentProperty dependentProperty) in D:\a\
1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 355
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.CheckDependentProperties(Symbol symbolWithProperties, DiagnosticBag diagnostics) in D:\a\1\s\source\Prod\Microsof
t.Dynamics.Nav.CodeAnalysis\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 158
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.DefaultVisit(Symbol symbol, DiagnosticBag diagnostics) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysi
s\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 57
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.VisitAction(ActionSymbol symbol, DiagnosticBag diagnostics) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAn
alysis\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 500
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.ActionSymbol.Accept[TArgument,TResult](SymbolVisitor`2 visitor, TArgument a) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Gene
rated\Symbols.Generated.cs:line 116
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.VisitMembersOfSymbol(Symbol symbol, DiagnosticBag diagnostics) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.Cod
eAnalysis\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 150
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.DefaultVisit(Symbol symbol, DiagnosticBag diagnostics) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysi
s\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 63
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.VisitAction(ActionSymbol symbol, DiagnosticBag diagnostics) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAn
alysis\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 500
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.ActionSymbol.Accept[TArgument,TResult](SymbolVisitor`2 visitor, TArgument a) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Gene
rated\Symbols.Generated.cs:line 116
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.VisitMembersOfSymbol(Symbol symbol, DiagnosticBag diagnostics) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.Cod
eAnalysis\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 150
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.DefaultVisit(Symbol symbol, DiagnosticBag diagnostics) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysi
s\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 63
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolVisitor`2.VisitContainer(ContainerSymbol node, TArgument argument) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Generate
d\SymbolVisitorWithArgumentAndResult.Generated.cs:line 326
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolVisitor`2.VisitType(TypeSymbol node, TArgument argument) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Generated\SymbolVi
sitorWithArgumentAndResult.Generated.cs:line 331
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolVisitor`2.VisitObjectType(ObjectTypeSymbol node, TArgument argument) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Genera
ted\SymbolVisitorWithArgumentAndResult.Generated.cs:line 336
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolVisitor`2.VisitRequestPageType(RequestPageTypeSymbol node, TArgument argument) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnaly
sis\Generated\SymbolVisitorWithArgumentAndResult.Generated.cs:line 281
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.RequestPageTypeSymbol.Accept[TArgument,TResult](SymbolVisitor`2 visitor, TArgument a) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnal
ysis\Generated\Symbols.Generated.cs:line 1199
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.VisitMembersOfSymbol(Symbol symbol, DiagnosticBag diagnostics) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.Cod
eAnalysis\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 150
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolWithPropertiesVisitor.DefaultVisit(Symbol symbol, DiagnosticBag diagnostics) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysi
s\Symbols\PropertyVisitor\SymbolWithPropertiesVisitor.cs:line 63
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolVisitor`2.VisitContainer(ContainerSymbol node, TArgument argument) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Generate
d\SymbolVisitorWithArgumentAndResult.Generated.cs:line 326
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolVisitor`2.VisitType(TypeSymbol node, TArgument argument) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Generated\SymbolVi
sitorWithArgumentAndResult.Generated.cs:line 331
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolVisitor`2.VisitObjectType(ObjectTypeSymbol node, TArgument argument) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Genera
ted\SymbolVisitorWithArgumentAndResult.Generated.cs:line 336
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolVisitor`2.VisitApplicationObjectType(ApplicationObjectTypeSymbol node, TArgument argument) in D:\a\1\s\source\Prod\Microsoft.Dynamics.N
av.CodeAnalysis\Generated\SymbolVisitorWithArgumentAndResult.Generated.cs:line 341
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolVisitor`2.VisitReportType(ReportTypeSymbol node, TArgument argument) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Genera
ted\SymbolVisitorWithArgumentAndResult.Generated.cs:line 271
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.ReportTypeSymbol.Accept[TArgument,TResult](SymbolVisitor`2 visitor, TArgument a) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\
Generated\Symbols.Generated.cs:line 1161
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileProperties(ContainerSymbol containingType) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.
cs:line 267
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileObject(ObjectTypeSymbol containingType) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:
line 171
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.VisitObjectType(ObjectTypeSymbol symbol) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 1
61
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SymbolVisitor.VisitReportType(ReportTypeSymbol node) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Generated\SymbolVisitor.Gene
rated.cs:line 271
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.ReportTypeSymbol.Accept(SymbolVisitor visitor) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Generated\Symbols.Generated.cs:lin
e 1151
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.<>c__DisplayClass11_0.<CompileModule>b__0(Symbol memberSymbol) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\Me
thodCompiler.cs:line 129
--- End of inner exception stack trace ---
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileModule(ModuleSymbol moduleSymbol) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 1
40
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileMethodBodies(Compilation compilation, ModuleBuilder moduleBeingBuiltOpt, Boolean hasDeclarationErrors, DiagnosticBag diagnostic
s, Predicate`1 filterOpt, Predicate`1 radCompilationFilter, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 10
3
at Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.CompileImpl(ModuleBuilder moduleBuilder, Boolean emittingPdb, DiagnosticBag diagnostics, Predicate`1 filterOpt, Predicate`1 radCompilatio
nFilter, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\Compilation.cs:line 1031
at Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.Compile(ModuleBuilder moduleBuilder, Boolean emittingPdb, DiagnosticBag diagnostics, Predicate`1 filterOpt, Predicate`1 radCompilationFil
ter, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\Compilation.cs:line 1003
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.PackageTheModule(Compilation compilation, CompilerTextWriter consoleOutput, CancellationToken cancellationToken, ErrorLogg
er errorLogger, AnalyzerDriver analyzerDriver, Predicate`1 filterOpt, Predicate`1 radCompilationFilter) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.
cs:line 721
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.RunCoreImpl(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, Compilation compilation, AnalyzerDriver analyzerDri
ver, IEnumerable`1 analyzerExceptionDiagnostics, IEnumerable`1 additionalTextFiles, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLin
e\CommonCompiler.cs:line 548
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.RunCore(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken) in D:\a\1\s\source
\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 479
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.Run(CompilerTextWriter consoleOutput, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.
CodeAnalysis\CommandLine\CommonCompiler.cs:line 333
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.Alc.<>c__DisplayClass1_0.<Run>b__0(CompilerTextWriter textWriterOut, CompilerTextWriter _) in D:\a\1\s\source\Prod\alc\Alc.cs:line 37
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.ConsoleUtil.RunWithOutput[T](Boolean useUtf8Encoding, Func`3 func) in D:\a\1\s\source\Prod\alc\ConsoleUtil.cs:line 25
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.Alc.Run(String clientDirectory, String baseDirectory, String[] args, IAnalyzerAssemblyLoader analyzerLoader) in D:\a\1\s\source\Prod\alc\
Alc.cs:line 37
App generation failed with exit code -1
Compile-AppInBcContainer Telemetry Correlation Id: 6d2e7783-6ab5-4991-8095-4b7d2abcd029
App generation failed with exit code -1
At C:\Program Files\WindowsPowerShell\Modules\bccontainerhelper\3.0.10\AppHandling\Compile-AppInNavContainer.ps1:651 char:72
+ ... | Where-Object { $_ -like "App generation failed*" } | % { throw $_ }
+ ~~~~~~~~
+ CategoryInfo : OperationStopped: (App generation failed with exit code -1:String) [], RuntimeException
+ FullyQualifiedErrorId : App generation failed with exit code -1
...
5. Versions:
- AL Language: v10.0.6.43374
- Visual Studio Code: 1.68.1
- Business Central: 21.0.43085.0
- List of Visual Studio Code extensions that you have installed: ** AL Language ** AL Extension Pack
Final Checklist
Please remember to do the following:
-
[x] Search the issue repository to ensure you are reporting a new issue
-
[x] Reproduce the issue after disabling all extensions except the AL Language extension
-
[x] Simplify your code around the issue to better isolate the problem Difficult to simplify the code since there are a lot of references in the AL objects.
Hello,
It has been 4 weeks and the problem has not been resolved yet. Can you please confirm the fix has been pushed and not still in development phase?
Hello,
It has been 4 weeks and the problem has not been resolved yet. Can you please confirm the fix has been pushed and not still in development phase?
Is there another issue for this? This particular issue was only opened 2 hours ago.
Can you also provide sample AL code that reproduces this issue? Looking at the callstack, it looks like some report request page property is triggering this.
Hello,
Ticket https://github.com/microsoft/AL/issues/7103 has been closed mentioning the fix has been put in place, but still isn't working.
Hello,
Ticket #7103 has been closed mentioning the fix has been put in place, but still isn't working.
It could be that the internal fix that we had wasn't exactly the same issue as the one you're running into. Can you provide sample AL code that reproduces this?
Hello,
It's a private app being developed, and is as large as the baseapp.
Please let me know your email address so I may send it over using a Storage account SAS blob link
Hello Thaddeus,
Please provide an update on this matter, as we need to make sure there are no issues when submitting our app to AppSource for the release in October.
Hi Thaddeus,
After some further investigation with the Reports, I can see 1 Report AL file being the cause, but can't find out what is causing it. Do you have a helpful link showing what the new AL compiler version is doing with the report files?
Hello Thaddeus,
I have resolved the issue. It seems that a 3rd party who has helped us with converting the C/AL to AL code has somehow added the following properties into the action block within a Report AL file:
- Promoted
- PromotedIsBig
This seemed to be ignored when compiling AL code using version 9 and earlier, but for some reason ALC v10 is now erroring on that, but without specific validation on why that is. I hope that is something you can update in the code to ensure it provides further clarity on the error.
This ticket can now be closed. Thank you
Hi @amea20, thank you for reporting this issue. It seems to be a different scenrio than the one reproduced internally. With your additional comment, we have been able to reproduce the issue with this snippet:
report 50100 MyReport
{
UsageCategory = ReportsAndAnalysis;
ApplicationArea = All;
requestpage
{
actions
{
area(processing)
{
action(ActionName)
{
ApplicationArea = All;
PromotedIsBig = true;
Promoted = true;
}
}
}
}
}
The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 22.0.46079.0 and VS Code Extension Version 11.0.676832.
If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo
For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://freddysblog.com/2020/06/25/working-with-artifacts/