Skip to content

WIN UI Failure: Operation is not valid due to the current state of the object. #150

@Volker911

Description

@Volker911

Hello, I am using MonkeyCache.FileStore with a new .NET 9 Maui project. Everything works well on Android, but the system fails on Windows UI.

In App.xaml.cs, I initialize the FileStore with: Barrel.ApplicationId = "IGT_OfflineData";

Then, I have the following three lines of code:

string test = "Failure Test";
string test2 = Barrel.ApplicationId;
Barrel.Current.Add("UserAppTheme", test, TimeSpan.FromDays(365));

When I debug, test2 equals "IGT_OfflineData", but the failure occurs at Barrel.Current.Add on the Windows machine. (On Android, everything works well.)

Here is the failure:

System.InvalidOperationException
HResult=0x80073D54
Nachricht = Operation is not valid due to the current state of the object.
Quelle = WinRT.Runtime
Stapelüberwachung:
bei WinRT.ExceptionHelpers.g__Throw|38_0(Int32 hr)
bei ABI.Windows.Storage.IApplicationDataStaticsMethods.get_Current(IObjectReference _obj)
bei Windows.Storage.ApplicationData.get_Current()
bei MonkeyCache.BarrelUtils.GetBasePath(String applicationId)
bei MonkeyCache.FileStore.Barrel.<>c__DisplayClass4_0.<.ctor>b__0()
bei System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) bei System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
bei System.Lazy`1.CreateValue()
bei MonkeyCache.FileStore.Barrel.LoadIndex()
bei MonkeyCache.FileStore.Barrel..ctor(String cacheDirectory, HashAlgorithm hash)
bei MonkeyCache.FileStore.Barrel.get_Current()
bei IGTConnect.AppShell.SfSegmentedControl_SelectionChanged(Object sender,

Hope someone can Help..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions