uno.extensions icon indicating copy to clipboard operation
uno.extensions copied to clipboard

[Windows][CustomApp] Operation is not valid due to the current state of the object.

Open agneszitte opened this issue 10 months ago • 6 comments

Current behavior

Operation is not valid due to the current state of the object occurs when launching the app for Windows when creating an app with latest template 5.3.0-dev.19 and using:

	dotnet new unoapp -o TestCustomApp530dev19 -preset "recommended" -platforms "android" -platforms "ios" -platforms "maccatalyst" -platforms "windows" -auth "oidc" -theme-service  -pwa False -maui  -theme "material" -presentation "mvvm" -config  -di  -log "serilog" -nav "regions" -http  -loc  -tests "unit" -tests "ui" -toolkit  -dsp  -id "com.companyname.TestCustomApp530dev19" -pub "O=TestCustomApp530dev19"
Equivalent to these options in the wizard: (expand to see)

image

Exception details to expand:
e.Exception.Message: 
Operation is not valid due to the current state of the object.
e.Exception.InnerException: 
null
e.Exception.StackTrace:
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|39_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Windows.Storage.IApplicationDataStaticsMethods.get_Current(IObjectReference _obj)
   at Windows.Storage.ApplicationData.get_Current()
   at Uno.Extensions.Storage.KeyValueStorage.ApplicationDataKeyValueStorage..ctor(ILogger`1 Logger, InMemoryKeyValueStorage InMemoryStorage, KeyValueStorageSettings Settings, ISerializer Serializer)
   at Uno.Extensions.Storage.KeyValueStorage.EncryptedApplicationDataKeyValueStorage..ctor(ILogger`1 EncryptedLogger, InMemoryKeyValueStorage InMemoryStorage, KeyValueStorageSettings Settings, ISerializer Serializer)
   at Uno.Extensions.ServiceCollectionExtensions.<>c.<AddKeyedStorage>b__2_3(ILogger`1 l, InMemoryKeyValueStorage inmem, KeyValueStorageSettings settings, ISerializer s)
   at Uno.Extensions.ServiceCollectionExtensions.CreateKeyValueStorage[TKeyValueStorage](IServiceProvider sp, String name, Func`5 creator)
   at Uno.Extensions.ServiceCollectionExtensions.<>c.<AddKeyedStorage>b__2_1(IServiceProvider sp)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Uno.Extensions.DependencyInjection.NamedInstance`2.GetRequired()
   at Uno.Extensions.ServiceCollectionExtensions.GetRequiredNamedService[TService](IServiceProvider sp, String Name)
   at Uno.Extensions.DependencyInjection.NamedInstanceReference`1.GetRequired()
   at Uno.Extensions.ServiceCollectionExtensions.GetRequiredNamedService[TService](IServiceProvider sp, String Name)
   at Uno.Extensions.ServiceCollectionExtensions.GetRequiredDefaultInstance[TService](IServiceProvider sp)
   at Uno.Extensions.HostBuilderExtensions.<>c.<UseAuthentication>b__3_1(IServiceProvider sp)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Uno.Extensions.HostBuilderExtensions.<>c__DisplayClass2_0`2.<AddAuthentication>b__1(IServiceProvider sp)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<>c__DisplayClass8_0.<<CreateViewModel>b__0>d.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<CreateViewModel>d__8.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator`1.<InitializeCurrentView>d__9.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator`1.<ExecuteRequestAsync>d__8.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<ControlNavigateAsync>d__6.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<>c__DisplayClass4_0.<<ControlCoreNavigateAsync>b__0>d.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Uno.Extensions.DispatcherExtensions.<>c__DisplayClass2_0`1.<<ExecuteAsync>b__0>d.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Uno.Extensions.Dispatcher.<ExecuteAsync>d__4`1.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<ControlCoreNavigateAsync>d__4.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<CoreNavigateAsync>d__3.MoveNext()
   at Uno.Extensions.Navigation.Navigator.<RegionNavigateAsync>d__37.MoveNext()
   at Uno.Extensions.Navigation.Navigator.<NavigateAsync>d__22.MoveNext()
   at Uno.Extensions.Navigation.FrameworkElementExtensions.<>c__DisplayClass1_1.<<HostAsync>b__6>d.MoveNext()
   at Uno.Extensions.Navigation.FrameworkElementExtensions.<Startup>d__2.MoveNext()
   at Uno.Extensions.ServiceProviderExtensions.<BuildAndInitializeHostAsync>d__5.MoveNext()
   at Uno.Extensions.ApplicationBuilderExtensions.<NavigateAsync>d__0`1.MoveNext()
   at TestCustomApp530dev19.App.<OnLaunched>d__9.MoveNext() in C:\Dev\Samples\Cli\TestCustomApp530dev19\TestCustomApp530dev19\App.xaml.cs:line 100
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Microsoft.UI.Dispatching.DispatcherQueueSynchronizationContext.<>c__DisplayClass2_0.<Post>b__0()
Call Stack:
>	TestCustomApp530dev19.dll!TestCustomApp530dev19.App.InitializeComponent.AnonymousMethod__12_2(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e) Line 75	C#
 	Microsoft.WinUI.dll!WinRT._EventSource_global__Microsoft_UI_Xaml_UnhandledExceptionEventHandler.EventState.GetEventInvoke.AnonymousMethod__1_0(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)	Unknown
 	Microsoft.WinUI.dll!ABI.Microsoft.UI.Xaml.UnhandledExceptionEventHandler.Do_Abi_Invoke(nint thisPtr, nint sender, nint e)	Unknown
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	WinRT.Runtime.dll!WinRT.ExceptionHelpers.ReportUnhandledError(System.Exception ex)	Unknown
 	Microsoft.InteractiveExperiences.Projection.dll!Microsoft.UI.Dispatching.DispatcherQueueSynchronizationContext.Post.AnonymousMethod__0()	Unknown
 	Microsoft.InteractiveExperiences.Projection.dll!ABI.Microsoft.UI.Dispatching.DispatcherQueueHandler.Do_Abi_Invoke(nint thisPtr)	Unknown
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	Microsoft.WinUI.dll!ABI.Microsoft.UI.Xaml.IApplicationStaticsMethods.Start(WinRT.IObjectReference _obj, Microsoft.UI.Xaml.ApplicationInitializationCallback callback)	Unknown
 	Microsoft.WinUI.dll!Microsoft.UI.Xaml.Application.Start(Microsoft.UI.Xaml.ApplicationInitializationCallback callback)	Unknown
 	TestCustomApp530dev19.dll!TestCustomApp530dev19.Program.Main(string[] args) Line 32	C#

Expected behavior

No exception

How to reproduce it (as minimally and precisely as possible)

  • Create an app using these options with cli with latest template 5.3.0-dev.19:

    otnet new unoapp -o TestCustomApp530dev19 -preset "recommended" -platforms "android" -platforms "ios" -platforms "maccatalyst" -platforms "windows" -auth "oidc" -theme-service  -pwa False -maui  -theme "material" -presentation "mvvm" -config  -di  -log "serilog" -nav "regions" -http  -loc  -tests "unit" -tests "ui" -toolkit  -dsp  -id "com.companyname.TestCustomApp530dev19" -pub "O=TestCustomApp530dev19"
    
    Equivalent to these options in the wizard: (expand to see)

    image

  • Try to launch the application for Windows

  • Notice the exception

Sample app used for the tests: TestCustomApp530dev19.zip

Environment

"Uno.Sdk": "5.3.0-dev.111"
<UnoExtensionsVersion>4.2.0-dev.13</UnoExtensionsVersion>
<UnoToolkitVersion>5.2.0-dev.56</UnoToolkitVersion>
<UnoThemesVersion>4.2.0-dev.30</UnoThemesVersion>
<UnoCSharpMarkupVersion>5.3.0-dev.11</UnoCSharpMarkupVersion>
Microsoft.WindowsAppSDK: 1.5.240311000
Microsoft.Windows.SDK.BuildTools: 10.0.22621.3233
MauiVersion: 8.0.6

Affected platform(s):

  • [ ] iOS
  • [ ] macOS (AppKit)
  • [ ] Mac Catalyst
  • [ ] Android
  • [ ] WebAssembly
  • [X] Windows
  • [ ] Skia (WPF)
  • [ ] Skia (GTK on Linux/macOS/Windows)
  • [ ] Skia (Linux Framebuffer)
  • [ ] Build tasks

Visual Studio:

  • [ ] 2019 (version: )
  • [X] 2022 (version: 17.9.2)
  • [ ] Visual Studio Code (version: )
  • [ ] Rider Windows (version: )
  • [ ] Rider macOS (version: )

agneszitte avatar Apr 09 '24 22:04 agneszitte

@agneszitte can you try running Windows as Packaged instead

nickrandolph avatar Apr 10 '24 17:04 nickrandolph

@agneszitte can you try running Windows as Packaged instead

@nickrandolph I am having this when trying to run Windows as Packaged image

But it is not specific to the options used for this issue, I can reproduce it with a simple blank maui embedding app as well. So I entered a separate issue for it: https://github.com/unoplatform/uno.extensions/issues/2244

agneszitte avatar Apr 10 '24 18:04 agneszitte

@agneszitte can you try running Windows as Packaged instead

@nickrandolph I am having this when trying to run Windows as Packaged !

But it is not specific to the options used for this issue, I can reproduce it with a simple blank maui embedding app as well. So I entered a separate issue for it: #2244

@Darsh0307 now that https://github.com/unoplatform/uno.extensions/issues/2244#top is supposed to be fixed, can you re-test for this issue with latest stable packages + latest stable template to see if you are still able to reproduce the issue for Windows (Unpackaged) and to test Windows (Packaged) please.

agneszitte avatar Apr 12 '24 22:04 agneszitte

Message

System.InvalidOperationException: 'Operation is not valid due to the current state of the object.

Inner exception :- None

Exception :- stack trace

   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|39_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Windows.Storage.IApplicationDataStaticsMethods.get_Current(IObjectReference _obj)
   at Windows.Storage.ApplicationData.get_Current()
   at Uno.Extensions.Storage.KeyValueStorage.ApplicationDataKeyValueStorage..ctor(ILogger`1 Logger, InMemoryKeyValueStorage InMemoryStorage, KeyValueStorageSettings Settings, ISerializer Serializer)
   at Uno.Extensions.Storage.KeyValueStorage.EncryptedApplicationDataKeyValueStorage..ctor(ILogger`1 EncryptedLogger, InMemoryKeyValueStorage InMemoryStorage, KeyValueStorageSettings Settings, ISerializer Serializer)
   at Uno.Extensions.ServiceCollectionExtensions.<>c.<AddKeyedStorage>b__2_3(ILogger`1 l, InMemoryKeyValueStorage inmem, KeyValueStorageSettings settings, ISerializer s)
   at Uno.Extensions.ServiceCollectionExtensions.CreateKeyValueStorage[TKeyValueStorage](IServiceProvider sp, String name, Func`5 creator)
   at Uno.Extensions.ServiceCollectionExtensions.<>c.<AddKeyedStorage>b__2_1(IServiceProvider sp)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Uno.Extensions.DependencyInjection.NamedInstance`2.GetRequired()
   at Uno.Extensions.ServiceCollectionExtensions.GetRequiredNamedService[TService](IServiceProvider sp, String Name)
   at Uno.Extensions.DependencyInjection.NamedInstanceReference`1.GetRequired()
   at Uno.Extensions.ServiceCollectionExtensions.GetRequiredNamedService[TService](IServiceProvider sp, String Name)
   at Uno.Extensions.ServiceCollectionExtensions.GetRequiredDefaultInstance[TService](IServiceProvider sp)
   at Uno.Extensions.HostBuilderExtensions.<>c.<UseAuthentication>b__3_1(IServiceProvider sp)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Uno.Extensions.HostBuilderExtensions.<>c__DisplayClass2_0`2.<AddAuthentication>b__1(IServiceProvider sp)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<>c__DisplayClass8_0.<<CreateViewModel>b__0>d.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<CreateViewModel>d__8.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator`1.<InitializeCurrentView>d__9.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator`1.<ExecuteRequestAsync>d__8.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<ControlNavigateAsync>d__6.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<>c__DisplayClass4_0.<<ControlCoreNavigateAsync>b__0>d.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Uno.Extensions.DispatcherExtensions.<>c__DisplayClass2_0`1.<<ExecuteAsync>b__0>d.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Uno.Extensions.Dispatcher.<ExecuteAsync>d__4`1.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<ControlCoreNavigateAsync>d__4.MoveNext()
   at Uno.Extensions.Navigation.Navigators.ControlNavigator.<CoreNavigateAsync>d__3.MoveNext()
   at Uno.Extensions.Navigation.Navigator.<RegionNavigateAsync>d__37.MoveNext()
   at Uno.Extensions.Navigation.Navigator.<NavigateAsync>d__22.MoveNext()
   at Uno.Extensions.Navigation.FrameworkElementExtensions.<>c__DisplayClass1_1.<<HostAsync>b__6>d.MoveNext()
   at Uno.Extensions.Navigation.FrameworkElementExtensions.<Startup>d__2.MoveNext()
   at Uno.Extensions.ServiceProviderExtensions.<BuildAndInitializeHostAsync>d__5.MoveNext()
   at Uno.Extensions.ApplicationBuilderExtensions.<NavigateAsync>d__0`1.MoveNext()
   at TestCustomApp530dev19.App.<OnLaunched>d__9.MoveNext() in C:\Users\DarshPatel\Desktop\finalQA\TestCustomApp530dev19\TestCustomApp530dev19\App.xaml.cs:line 100

Darsh0307 avatar Apr 15 '24 02:04 Darsh0307

Enviournment :-

Templates :- Uno.Templates.5.3.0-dev.31.nupkg



  "Uno.Sdk": "5.3.0-dev.315"
<UnoExtensionsVersion>4.2.0-dev.13</UnoExtensionsVersion>
  <UnoToolkitVersion>5.2.0-dev.56</UnoToolkitVersion>
  <UnoThemesVersion>4.2.0-dev.30</UnoThemesVersion>
  <UnoCSharpMarkupVersion>5.3.0-dev.11</UnoCSharpMarkupVersion>
  <!-- <WindowsSdkPackageVersion>10.0.22621.28</WindowsSdkPackageVersion> -->


Darsh0307 avatar Apr 15 '24 02:04 Darsh0307

The exception error is still same , even in the newest versions of 5.2 version. @agneszitte since the errorr message is same , should i add the exception error again ?

Uno.Templates.5.2.28
    "Uno.Sdk": "5.2.83"
  <UnoExtensionsVersion>4.1.14</UnoExtensionsVersion>
  <UnoToolkitVersion>6.0.18</UnoToolkitVersion>
  <UnoThemesVersion>5.0.13</UnoThemesVersion>
  <UnoCSharpMarkupVersion>5.2.13</UnoCSharpMarkupVersion>

Darsh0307 avatar Apr 23 '24 18:04 Darsh0307

@agneszitte / @Darsh0307 what's the status on this?

nickrandolph avatar May 07 '24 05:05 nickrandolph

@agneszitte / @Darsh0307 what's the status on this?

@Darsh0307 I moved this to your list last week. Can you re-test it with latest dev versions to give us an update, please

agneszitte avatar May 08 '24 03:05 agneszitte

Sure @agneszitte , i will test this one. :)

Darsh0307 avatar May 08 '24 03:05 Darsh0307

The error is still there with same exception mentioned and all.

The App was created using CLi , The cli was dotnet new unoapp -o TestCustomApp530dev19 -preset "recommended" -platforms "android" -platforms "ios" -platforms "maccatalyst" -platforms "windows" -auth "oidc" -theme-service -pwa False -maui -theme "material" -presentation "mvvm" -config -di -log "serilog" -nav "regions" -http -loc -tests "unit" -tests "ui" -toolkit -dsp -id "com.companyname.TestCustomApp530dev19" -pub "O=TestCustomApp530dev19"

Darsh0307 avatar May 08 '24 18:05 Darsh0307

This issue happens because Windows.Storage.ApplicationData.Current cannot be used in unpackaged mode:

https://github.com/unoplatform/uno.extensions/blob/74a945f7b6bbd3bf62c9deb64403d1e2ea20caf7/src/Uno.Extensions.Storage.UI/KeyValueStorage/ApplicationDataKeyValueStorage.cs#L14-L15

@nickrandolph haven't you built a file storage based version of this abstraction for this specific case?

jeromelaban avatar Jun 12 '24 01:06 jeromelaban

The storage issue with Application Data Key Value Storage has been occurring for a long time.

The problem is this https://github.com/microsoft/WindowsAppSDK/issues/2639

You have extended Settings why not use it here

HaoLife avatar Jun 12 '24 10:06 HaoLife