I okay I went straight to the owner of this, and he said that 
GetUserStoreForApplication and GetMachineStoreForApplication only for use in a 
ClickOnce deployed app.

From: [email protected] [mailto:[email protected]] On 
Behalf Of Maddin, Peter
Sent: Sunday, March 14, 2010 11:12 PM
To: ozDotNet
Subject: RE: Isolated Storage Security

This is driving me nuts (ok, I was nuts already, nuttier then).

Apart from publishing it I have tried everything else.

I created a key file and signed the assembly with it. No Dice!

I have saved my certificate in the root certificate store despite the 
protestations that this was not a wise thing to do (hey, if I can't trust me 
who can I trust).
I ticked the check box to sign the ClickOnce Manifest with my certificate and 
did a rebuild.
Still no dice. I guess one really needs to publish it before anything happens 
here but I was willing to try it.


[cid:[email protected]]

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : [email protected]<mailto:[email protected]>
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: [email protected] [mailto:[email protected]] On 
Behalf Of Maddin, Peter
Sent: Monday, 15 March 2010 1:55 PM
To: ozDotNet
Subject: RE: Isolated Storage Security

Tried to decorate my button event handler thus

        [IsolatedStorageFilePermission(SecurityAction.Assert)]
        private void button1_Click(object sender, EventArgs e)
        {
            listBox1.Items.Add("GetMachineStoreForApplication : " + 
IsolatedStorageFile.GetMachineStoreForApplication());
            listBox1.Items.Add("GetMachineStoreForAssembly : " + 
IsolatedStorageFile.GetMachineStoreForAssembly());
            listBox1.Items.Add("GetMachineStoreForDomain : " + 
IsolatedStorageFile.GetMachineStoreForDomain());
            listBox1.Items.Add("GetUserStoreForApplication : " + 
IsolatedStorageFile.GetUserStoreForApplication());
            listBox1.Items.Add("GetUserStoreForAssembly : " + 
IsolatedStorageFile.GetUserStoreForAssembly());
            listBox1.Items.Add("GetUserStoreForDomain : " + 
IsolatedStorageFile.GetUserStoreForDomain());

        }

No deal. Still get the exception. Use of either SecurityAction.Assert or 
SecurityAction.Demand makes no difference.

I tried to establish FullTrust at the assembly level

[assembly: PermissionSetAttribute(SecurityAction.RequestMinimum, Name = 
"FullTrust")]

Still no dice.
Why does something that should be simple have to be made so hard??

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : [email protected]<mailto:[email protected]>
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: [email protected] [mailto:[email protected]] On 
Behalf Of Maddin, Peter
Sent: Monday, 15 March 2010 1:47 PM
To: [email protected]
Subject: Isolated Storage Security

Currently using XP Pro as our SOE. Will be moving to Win 7 with PC fleet 
replacement.

I want to write my applications so that I can persist application/assembly 
settings and also user settings so it will run with Win 7.
This is probably really old ground for most so I apologise for bringing 
something up that has probably been dealt to death previously.

I have written a really basic application to discover where these are. I am 
just adding the possible locations to a listbox.

            listBox1.Items.Add("GetMachineStoreForApplication : " + 
IsolatedStorageFile.GetMachineStoreForApplication());
            listBox1.Items.Add("GetMachineStoreForAssembly : " + 
IsolatedStorageFile.GetMachineStoreForAssembly());
            listBox1.Items.Add("GetMachineStoreForDomain : " + 
IsolatedStorageFile.GetMachineStoreForDomain());
            listBox1.Items.Add("GetUserStoreForApplication : " + 
IsolatedStorageFile.GetUserStoreForApplication());
            listBox1.Items.Add("GetUserStoreForAssembly : " + 
IsolatedStorageFile.GetUserStoreForAssembly());
            listBox1.Items.Add("GetUserStoreForDomain : " + 
IsolatedStorageFile.GetUserStoreForDomain());

It bombs on the first line with a IsolatedStorageException "Unable to determine 
application identity of the caller."

>From looking around (Google etc). Once one deploys with ClickOnce this issue 
>goes away. Ok but what does one do prior to this? What of one wants to use 
>something other than ClickOnce!

What does one do to get it to work? Strongly name it? Does one have to take 
some action so that it will work when one  is developing and then another after 
one has deployed it.

I tried this in the form load event

        public Form1()
        {
            InitializeComponent();

            IsolatedStorageFilePermission isfp = new 
IsolatedStorageFilePermission(PermissionState.Unrestricted);
            isfp.Assert();

        }

But this does nothing.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : [email protected]<mailto:[email protected]>
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

<<inline: image001.png>>

Reply via email to