Click to See Complete Forum and Search --> : [RESOLVED] IsolatedStorage Exception


JonnyPoet
July 27th, 2008, 04:05 PM
Hi friends !
I'm trying to access Isolated storage. For learning reasns I have done an console application
namespace IsolatedStorage {
class Program {
static void Main(string[] args) {
IsolatedStorageFile userStore = IsolatedStorageFile.GetUserStoreForApplication();
//...
This throws the exceptin telling me that the Application-Idendity of the caller couldn't be defined. ( Maybe a bit different, because difficult to translate ) The code is from an example in a MS book for exam 70-536
This seems me to be a security issue, but there is nothing really helpful for me to be found in calling the help regarding this error. ( This is in Chapter 2 and all security things are in chapter 12 ! Far away from my actual knowledge about this.
Anyone knows what to do to get this working ?
BTW I'm using VS 2005 and Vista as OS

darwen
July 27th, 2008, 04:25 PM
Have you tried strong-naming your application ? This is just a guess...

Darwen.

JonnyPoet
July 27th, 2008, 05:18 PM
Have you tried strong-naming your application ? This is just a guess...

Darwen.No not in between. But I have found out that there might be a difference in if I use GetUserStoreForApplication() which creates the error or GetUserStoreForAssmbly() which I have seen is used some pages later in the solution they provided. ( I'm trying to read the text and doing my examples myself normally).The book told that there is
IsolatedStorageFile machineStorage = IsolatedStorageFile.GetMachineStoreForAssembly();
and alsoIsolatedStorageFile userStorage =IsolatedStorageFile.GetUserStoreForAssembly();
and additional
IsolatedStorageFile userStore = IsolatedStorageFile.GetUserStoreForApplication(); I thought that maybe GetUserStoreForAssembly() will be used for dlls and for an Application to use GetUserStoreForApplication(); ( This was my logic for that naming conventions ).

A short tryout of the bookexample showed me that GetUserStoreForAssembly() is the only one which doesn't throw the exception. So maybe the solution for the other two is in chapter 12 :D
and therefore they used GetUserStoreForAssembly() Anyone knows the difference and wahts needed to do to get the other storage working too ?
-------------- edited ------
You are near to the truth. I needed to activate 'ClickOnce' application and using this GetUserStoreForApplication(); works without any problems. :thumb: Your hint directed me into the ight direction and therefor I did a look into the book again and found a note regarding ClickOnce application, which I didn't look before.