Skip to main content

Notifications

Business Central forum
Suggested answer

Error while publishing base application when upgrading BC from v20 to v23 on-premise

editSubscribe (0) ShareShare
ReportReport
Posted on by 18
Hello,
I got error while publish Microsoft Base Application when upgrading business central v20 to v23. I don't know what's happen and I did follow this guide https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-technical-upgrade-v23 and still stuck in section publish new base application (v23). Anyone have the same issue like this? If you faced the same problem please share the solutions to me.
Thanks in advance.
 
Errors : 
Publish-NAVApp : Extension compilation failed
System/Exchange/ExchangeWebServicesClient.Codeunit.al(249,46): error AL0133: Argument 1: cannot convert from 'DotNet 
/Microsoft.Exchange.WebServices.Data.OAuthCredentials/' to 'DotNet 
/Microsoft.Exchange.WebServices.Data.ExchangeCredentials/'
System/Exchange/ExchangeWebServicesServer.Codeunit.al(38,42): error AL0133: Argument 1: cannot convert from 'DotNet 
/Microsoft.Exchange.WebServices.Data.ExchangeCredentials/' to 'DotNet 
/Microsoft.Exchange.WebServices.Data.ExchangeCredentials/'
O365SyncManagement.Codeunit.al(433,46): error AL0133: Argument 1: cannot convert from 'DotNet 
/Microsoft.Exchange.WebServices.Data.ExchangeCredentials/' to 'DotNet 
/Microsoft.Exchange.WebServices.Data.ExchangeCredentials/'
At line:1 char:1
+ Publish-NAVApp -ServerInstance $NewBcServerInstance -Path /C://Microso ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Publish-NAVApp], InvalidOperationException
    + FullyQualifiedErrorId : MicrosoftDynamicsNavServer$BC23/nav-systemapplication,Microsoft.Dynamics.Nav.Apps.Man 
   agement.Cmdlets.PublishNavApp
 
And this is my powershell script that I used for this time.
Get-NAVAppInfo -ServerInstance $OldBcServerInstance  | % { Uninstall-NAVApp -ServerInstance $OldBcServerInstance -Name $_.Name -Version $_.Version }
Get-NAVAppInfo -ServerInstance $OldBcServerInstance  -SymbolsOnly | % { Unpublish-NAVApp -ServerInstance $OldBcServerInstance -Name $_.Name -Version $_.Version }
Invoke-NAVApplicationDatabaseConversion -DatabaseServer $DatabaseServer -DatabaseName $ApplicationDatabase
Import-NAVServerLicense -ServerInstance $NewBcServerInstance -LicenseFile $PartnerLicense
Get-NAVAppInfo -ServerInstance $NewBcServerInstance | Repair-NAVApp
Restart-NAVServerInstance -ServerInstance $NewBcServerInstance
Sync-NAVTenant -ServerInstance $NewBcServerInstance -Tenant default -Mode Sync
Categories:
  • Suggested answer
    Kittamet R. Profile Picture
    Kittamet R. 18 on at
    Error while publishing base application when upgrading BC from v20 to v23 on-premise
    Hi All,
     
    Now I able to upgrade version from 20 to 23 successfully. For the last error I found the root cause are SqlCommandTimeout is too short for running NAVAppDataUpgrade so I increase from 30 mins. to 8 hrs. and the next is my disk is run out of space just cleaning to free some space that's all
     
    Thank you so much everyone to help me.
  • Kittamet R. Profile Picture
    Kittamet R. 18 on at
    Error while publishing base application when upgrading BC from v20 to v23 on-premise
    Hi Mohana,
     
    I tried to increase SqlCommandTimeout from 30 minutes to 8 hrs. but still faced the same errors. It's take times around 1 hour and then error occurs.
     
    Current configuration

    PS. My database size around 100gb
  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 45,264 Super User on at
    Error while publishing base application when upgrading BC from v20 to v23 on-premise
    It could be due to SqlCommandTimeout if it failed around 30 mins.
    Please increase the timeout, restart the service and try again.
  • Suggested answer
    Kittamet R. Profile Picture
    Kittamet R. 18 on at
    Error while publishing base application when upgrading BC from v20 to v23 on-premise
    Hello Everyone,
     
    This is the latest update from me.
     
    I found the root cause is from copy the contents of the NavEwsWrapper from V20 to Add-ins folder in V23 (related to this article) and after I uninstall and re-install again it's able to publish base application successfully.
     
    but I got another error when using this command
    (Start-NAVAppDataUpgrade -ServerInstance $NewBcServerInstance -Name "Base Application" -Version 23.7.18957.0)

    I'm not sure is it related to SqlCommandTimeout or not? because it's take a long time to running command data upgrade.
    This is BC sql configuration currently.



    Error : 
    Type: System.InvalidOperationException
    Message:
      Could not upgrade the extension 'Base Application' by 'Microsoft' from version '20.4.44313.44365' to '23.7.18957.0' for tenant 'default' and company 'Production' due to the following error: 'An unexpected error occurred after a database command was cancelled.' and AL stack trace: 
      "Update VAT Date Field"(CodeUnit 104051).DataTransferGLEntries line 9 - Base Application by Microsoft
      "Update VAT Date Field"(CodeUnit 104051).UpdateGLEntries line 25 - Base Application by Microsoft
      "Update VAT Date Field"(CodeUnit 104051).OnUpgradePerCompany line 3 - Base Application by Microsoft
      "Upgrade Triggers"(CodeUnit 2000000008).OnUpgradePerCompany(Event) line 2
      
    HResult: -2146233079

  • Kittamet R. Profile Picture
    Kittamet R. 18 on at
    Error while publishing base application when upgrading BC from v20 to v23 on-premise
    Update
     
    After import bclicense completed then publish system application completed but base application still failed with the same errors.

    Type: System.InvalidOperationException
    Message:
      Extension compilation failed
      System/Exchange/ExchangeWebServicesClient.Codeunit.al(249,46): error AL0133: Argument 1: cannot convert from 'DotNet "Microsoft.Exchange.WebServices.Data.OAuthCredentials"' to 'DotNet "Microsoft.Exchange.WebServices.Data.ExchangeCredentials"'
      System/Exchange/ExchangeWebServicesServer.Codeunit.al(38,42): error AL0133: Argument 1: cannot convert from 'DotNet "Microsoft.Exchange.WebServices.Data.ExchangeCredentials"' to 'DotNet "Microsoft.Exchange.WebServices.Data.ExchangeCredentials"'
      O365SyncManagement.Codeunit.al(433,46): error AL0133: Argument 1: cannot convert from 'DotNet "Microsoft.Exchange.WebServices.Data.ExchangeCredentials"' to 'DotNet "Microsoft.Exchange.WebServices.Data.ExchangeCredentials"'
    HResult: -2146233079
     
    PS. I'm using this version of BC 23

  • Kittamet R. Profile Picture
    Kittamet R. 18 on at
    Error while publishing base application when upgrading BC from v20 to v23 on-premise
    Hi gdrenteria,
     
    Thank you so much I can import bclicense now.
  • gdrenteria Profile Picture
    gdrenteria 3,108 Super User on at
  • Kittamet R. Profile Picture
    Kittamet R. 18 on at
    Error while publishing base application when upgrading BC from v20 to v23 on-premise
    Hi Saurav,
     
    Thanks for your reply.
     
    I did follow your videos and got new error but the old errors I didn't use this command before convert database.
     
    UPDATE [master].[dbo].[$ndo$srvproperty] SET [license] = null
    UPDATE [<app database name>].[dbo].[$ndo$dbproperty] SET [license] = null
    UPDATE [<tenant database name>].[dbo].[$ndo$tenantproperty] SET [license] = null
     
    I'm not sure it's related or not? 
     
    And this is new error after user command to import new partner license. (Import-NAVServerLicense -ServerInstance $NewBcServerInstance -LicenseFile $PartnerLicense)
     
    Type: System.ServiceModel.FaultException`1[[Microsoft.Dynamics.Nav.Types.ServerFault, Microsoft.Dynamics.Nav.Types, Version=23.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]
    Action: http://www.microsoft.com/Dynamics/NAV/51/ServerFault
    Message: An unexpected error occurred after a database command was cancelled.
    StackTrace:
      
      Server stack trace: 
         at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
         at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
         at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
         at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
      
      Exception rethrown at [0]: 
         at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
         at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
         at Microsoft.BusinessCentral.AdminApi.INCLAdminService.ImportLicense(Byte[] license, LicenseDatabase licenseDatabase)
         at Microsoft.Dynamics.Nav.Management.Cmdlets.ImportNavServerLicense.InternalProcessRecord()
         at Microsoft.Dynamics.Nav.Management.NavCommand.ProcessRecord()
    Source: mscorlib
    HResult: -2146233087
    StackTrace:
      
      Server stack trace: 
         at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
         at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
         at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
         at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
      
      Exception rethrown at [0]: 
         at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
         at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
         at Microsoft.BusinessCentral.AdminApi.INCLAdminService.ImportLicense(Byte[] license, LicenseDatabase licenseDatabase)
         at Microsoft.Dynamics.Nav.Management.Cmdlets.ImportNavServerLicense.InternalProcessRecord()
         at Microsoft.Dynamics.Nav.Management.NavCommand.ProcessRecord()
     
  • Suggested answer
    Saurav.Dhyani Profile Picture
    Saurav.Dhyani 10,155 User Group Leader on at
    Error while publishing base application when upgrading BC from v20 to v23 on-premise
    Hi,
     
    If you are trying to do a full upgrade, then you are referring the wrong article.
     
     
    You can also refer this video - https://youtu.be/J6O6rzUjE4Y (Steps will be more or less same).
     
    Regards,
    Saurav Dhyani
  • EE-04050459-0 Profile Picture
    EE-04050459-0 6 on at
    I got a problem when upgrading business central v20 to v23 on-premise
    I think it's already installed when I install business central. Is that correct?

Helpful resources

Quick Links

Take the Community feedback survey!

Answer this brief 15-question survey about your Community experience…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,375 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,308 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans