Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Unable to determine application identity of the caller Error

Tags:

c#

.net

winforms

I need to store and retrieve data in Isolated storage mode in a winforms application. I have followed this msdn article and this is the code

  IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.Machine | IsolatedStorageScope.Application,null,null);

When I exceute the above code I am getting Unable to determine application identity of the caller error.

Could anyone help me too solve this issue ?

Regards

Ramalingam S

like image 868
Ramalingam Avatar asked Dec 07 '11 08:12

Ramalingam


3 Answers

In a WinForms application, GetMachineStoreForApplication() or IsolatedStorageScope.Application do not work. The application speciifc storages are designed for ClickOnce applications only.

Instead, use GetMachineStoreForAssembly() or IsolatedStorageScope.User if you want to store settings on a per-user basis.

like image 77
Thomas Weller Avatar answered Nov 02 '22 05:11

Thomas Weller


Many examples from MSDN for Isolated storage appear incomplete.

You want to call these instead of GetStore:

  • GetMachineStoreForApplication()
  • GetMachineStoreForAssembly()
  • GetMachineStoreForDomain()
like image 25
Gone Coding Avatar answered Nov 02 '22 05:11

Gone Coding


Please use this:

IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly, null, null)
like image 23
juFo Avatar answered Nov 02 '22 04:11

juFo