"Sequence contains no matching element" between dependent apps
Hi, I have the same problem of these issues: #399 #495
I will try to explain how to reproduce it:
- Create an extension, "App1" (with Table "App1 Table 1" with 3 fields)
- Create another extension "App2" that depends from "App1" (with Tableextension to "App1 Table 1", add a field)
- Create another extension "App3" that depends from "App1" and "App2" (with Tableextension to "App1 Table 1", add a field)
The installation of these three extensions in order does not cause any error. If update App3 no problem. If update App2 (uninstalling and unpublishing App3) no problem. If update App1 (uninstalling and unpublishing App2 and App3) no problem.
When I remove a field from App1 table, I have to uninstall and unpublish App1, App2 and App3 and run the "Clean" command: Sync-NAVApp -ServerInstance DynamicsNAV110 -Name "App1" -Mode Clean
Now, if I install App1 and App2 no problem, but when I install App3 I have this issue: "Sequence contains no matching element, A call to Microsoft.Dynamics.Nav.Runtime.Apps.NavAppALInstaller.ALGetAppDependenciesToInstallString failed with this message: Sequence contains no matching element"
More detailed error message from Event Viewer:
Type: System.InvalidOperationException
Message: <ii>Sequence contains no matching element</ii>
StackTrace:
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppV2DependencyResolver.<>c__DisplayClass2_2.<PackagesAppDependsOn>b__6(NavAppRuntimeDependencyDefinition p)
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppV2DependencyResolver.PackagesAppDependsOn(NavAppRuntimeMetadata runtimeMetadata, IEnumerable`1 installed, IEnumerable`1 uninstalled, IEnumerable`1 published, IEnumerable`1 synced, Boolean checkSyncState)
at Microsoft.Dynamics.Nav.Runtime.NavManagementTasks.InstallNavAppPrecheck(String name, String publisher, Version version, NavTenant tenant, Boolean force, Boolean doNotLoadData)
at Microsoft.Dynamics.Nav.Runtime.NavManagementTasks.<>c__DisplayClass25_0.<InstallNavApp>b__1(NavTenant tenant, NavSession session)
at Microsoft.Dynamics.Nav.Runtime.NavTenant.Microsoft.Dynamics.Nav.Runtime.ITenantSessionHandler.RunTenantActionInSystemSession(Action`2 action, Boolean throwExceptions, Boolean useCurrentCulture, Boolean allowAppsDisabledMode)
at Microsoft.Dynamics.Nav.Runtime.NavManagementTasks.<>c__DisplayClass25_0.<InstallNavApp>b__0()
at Microsoft.Dynamics.Nav.Runtime.NavManagementTasks.InstallNavApp(InstallNavAppArguments installNavAppArguments, Boolean async)
at Microsoft.Dynamics.Nav.Service.NSAdminService.<>c__DisplayClass54_0.<Microsoft.Dynamics.Nav.Types.INCLAdminService.InstallNavApp>b__0(NavSession session)
at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppDiagnosticSession.<>c__DisplayClass1_0`1.<SendTraceTagOnFailure>b__0()
at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppDiagnosticSession.SendTraceTagOnFailure(Action operation, String additionalInfo, String callerName)
at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppDiagnosticSession.SendTraceTagOnFailure[T](Func`1 operation, String additionalInfo, String callerName)
at Microsoft.Dynamics.Nav.Service.NSAdminService.Microsoft.Dynamics.Nav.Types.INCLAdminService.InstallNavApp(InstallNavAppArguments installNavAppArguments)
at SyncInvokeInstallNavApp(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs)
In attachment you find three example project: Examples.zip
Thanks for the good repro! We'll take a look into this.
This issue has been fixed and will be included in the next update. Thank you for reporting the issue!