Skip to content
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

In BC24.x container, the command Invoke-NAVApplicationDatabaseConversion fails with TypeLoad exception #560

Open
geschwint opened this issue Jul 2, 2024 · 1 comment

Comments

@geschwint
Copy link

When creating a container for BC24 using the default image as created by New-BcContainer, the command Invoke-NAVApplicationDatabaseConversion generates a primitive error about a missing type during the first phase of doing an upgrade.

Creating a container for BC23 the same way, the command Invoke-NAVApplicationDatabaseConversion works fine. Thus this is stopping upgrades to BC24 using containers.

BcContainerHelper used is 6.0.19 but I do not suspect that module.

The error message:
Error: Could not load type 'Microsoft.Extensions.Logging.ILoggingBuilder' from assembly 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

The stacktrace as seen in the eventlog extracted from the container with BC24:
Type: System.TypeLoadException
Message: Could not load type 'Microsoft.Extensions.Logging.ILoggingBuilder' from assembly 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
TypeName: Microsoft.Extensions.Logging.ILoggingBuilder
Source: Microsoft.BusinessCentral.Telemetry.OpenTelemetry
HResult: -2146233054
StackTrace:
at Microsoft.BusinessCentral.Telemetry.OpenTelemetry.OpenTelemetryLogger1..ctor(Dictionary2 contextColumns, String logFileFolderOnlyUseDuringDevelopment, Boolean enableLoggingToEventLog, LogLevel minimumLogLevel)
at Microsoft.Dynamics.Nav.Diagnostic.NavOpenTelemetryLogger..ctor(Verbosity traceLevel, Dictionary`2 contextColumns, String logFileFolderOnlyUseDuringDevelopment)
at Microsoft.Dynamics.Nav.Runtime.NavEnvironment..ctor(NavEnvironmentFlags flags)
at Microsoft.Dynamics.Nav.Runtime.NavEnvironment.InstantiateStandaloneNavEnvironment(Boolean enableNavApps, Boolean developmentMode, Boolean removeAllAppsMode)
at Microsoft.Dynamics.Nav.Management.Cmdlets.InvokeNAVApplicationDatabaseConversion.InternalProcessRecord()
at Microsoft.Dynamics.Nav.Management.NavCommand.ProcessRecord()

@geschwint
Copy link
Author

I will add the solution that I found to this issue and close it. Issue most likely not related to nav-docker per-se, but I add the solution here for the use of anyone else that has the same issue. This made the data upgrade work in the container.

Run the database conversion in a new session due to possible dependency conflicts
Reference to solution https://learn.microsoft.com/en-us/powershell/scripting/dev-cross-plat/resolving-dependency-conflicts?view=powershell-7.4

`
$NavAdminTool = (Get-Item 'C:\Program Files\Microsoft Dynamics NAV*\Service\NavAdminTool.ps1').FullName

pwsh -c "Import-Module '$($NavAdminTool)' | Out-Null; Invoke-NAVApplicationDatabaseConversion -DatabaseServer $DatabaseServer -DatabaseName $DatabaseName -Force"
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant