Skip to content

Load Analyzers\Microsoft.Dynamics.Nav.Analyzers.Common.dll when analyzers are enabled #3920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions AppHandling/Compile-AppInNavContainer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,15 @@ try {
if ($GenerateReportLayoutParam) {
$alcParameters += @($GenerateReportLayoutParam)
}

# Microsoft.Dynamics.Nav.Analyzers.Common.dll needs to referenced first, as this is how the analyzers are loaded
if ($EnableCodeCop -or $EnableAppSourceCop -or $EnablePerTenantExtensionCop -or $EnableUICop) {
$analyzersCommonDLLPath = Join-Path $binPath 'Analyzers\Microsoft.Dynamics.Nav.Analyzers.Common.dll'
if (Test-Path $analyzersCommonDLLPath) {
$alcParameters += @("/analyzer:$(Join-Path $binPath 'Analyzers\Microsoft.Dynamics.Nav.Analyzers.Common.dll')")
}
}

if ($EnableCodeCop) {
$alcParameters += @("/analyzer:$(Join-Path $binPath 'Analyzers\Microsoft.Dynamics.Nav.CodeCop.dll')")
}
Expand Down
11 changes: 10 additions & 1 deletion CompilerFolderHandling/Compile-AppWithBcCompilerFolder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ try {
$alcExe = 'alc'
$alcCmd = "./$alcExe"
}
}
}

if (!(Test-Path -Path (Join-Path $alcPath $alcExe))) {
$alcCmd = "dotnet"
Expand All @@ -367,6 +367,15 @@ try {
if ($GenerateReportLayoutParam) {
$alcParameters += @($GenerateReportLayoutParam)
}

# Microsoft.Dynamics.Nav.Analyzers.Common.dll needs to referenced first, as this is how the analyzers are loaded
if ($EnableCodeCop -or $EnableAppSourceCop -or $EnablePerTenantExtensionCop -or $EnableUICop) {
$analyzersCommonDLLPath = Join-Path $binPath 'Analyzers\Microsoft.Dynamics.Nav.Analyzers.Common.dll'
if (Test-Path $analyzersCommonDLLPath) {
$alcParameters += @("/analyzer:$(Join-Path $binPath 'Analyzers\Microsoft.Dynamics.Nav.Analyzers.Common.dll')")
}
}

if ($EnableCodeCop) {
$alcParameters += @("/analyzer:$(Join-Path $binPath 'Analyzers\Microsoft.Dynamics.Nav.CodeCop.dll')")
}
Expand Down
3 changes: 2 additions & 1 deletion ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
6.1.5
Include AuthContext and Environment in Parameters for InstallMissingDependencies when called from Run-AlPipeline
AL-Go issue 1695 Fail early if app.json cannot be read
Issue with BC artifact 27.0.33668.0: app compilation fails because of analyzers not being loaded properly

6.1.4
Issue 3882 Run-AlPipeline with CompilerFolder and Container defined fails when running tests
Expand Down Expand Up @@ -102,7 +103,7 @@ Include AI Toolkit when copying symbols from container
Issue 3714 Download-BcNuGetPackageToFolder - throws error when use "-select Exact"
Issue 3621 New-AadAppsForBc shows "-includeEmailAadApp is deprecated. Use -includeOtherServicesAadApp instead." but includeOtherServicesAadApp us not setting email permissions
Issue 3718 Business Central Web Client Fails to Load After Updating to Windows 24H2
Issue #3703 Missing Function Download-BcEnvironmentInstalledExtensionToFolder
Issue #3703 Missing Function Download-BcEnvironmentInstalledExtensionToFolder
Fix for issue 1262 in AL-Go for GitHub
Fix instabilities during Publish-PerTenantExtensionApps

Expand Down