PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms BinaryFormatter Alternatives with limitied security priviledges

Reply

BinaryFormatter Alternatives with limitied security priviledges

 
Thread Tools Rate Thread
Old 24-06-2003, 06:17 AM   #1
Phil Jones
Guest
 
Posts: n/a
Default BinaryFormatter Alternatives with limitied security priviledges


I want to write class that effectively caches object state between instances
of a WindowsForms application running.



The obvious device to use is the [BinaryFormatter] within the
Runtime.Serialization namespace.



However, I would also like the class to be operable within a
No-Touch-Deployment instance, which means I want to work within the
IsolatedStorage container, and within the "Internet Zone" I'm not allowed to
use the [BinaryFormatter] because of the limited permission set.



Is there another way to save and restore the an object instance that is
usable within a limited security context?



Thanks anyone?




--
Phil
New Zealand (Aotearoa)


  Reply With Quote
Old 25-06-2003, 11:51 AM   #2
Duke Sun
Guest
 
Posts: n/a
Default RE: BinaryFormatter Alternatives with limitied security priviledges

Hope the following articles can be of assistance:

Title: Binary Serialization
URL:
http://msdn.microsoft.com/library/d...-us/cpguide/htm
l/cpconbinaryserialization.asp




  Reply With Quote
Old 25-06-2003, 10:14 PM   #3
Phil Jones
Guest
 
Posts: n/a
Default Re: BinaryFormatter Alternatives with limitied security priviledges

Cheers,

I've read up on it, and basically the formatter throws an exception at
construction if it doesn't have enough priveledges. Just 'aint no way to
do' binary with out the security pass.

Thanks...

--
Phil
New Zealand (Aotearoa)


"Duke Sun" <quansun@microsoft.com> wrote in message
news:nBqmxAxODHA.2284@cpmsftngxa06.phx.gbl...
> Hope the following articles can be of assistance:
>
> Title: Binary Serialization
> URL:
>

http://msdn.microsoft.com/library/d...-us/cpguide/htm
> l/cpconbinaryserialization.asp
>
>
>
>



  Reply With Quote
Old 26-06-2003, 02:14 PM   #4
Duke Sun
Guest
 
Posts: n/a
Default Re: BinaryFormatter Alternatives with limitied security priviledges

Could you please a sample to reproduce the issue?

  Reply With Quote
Old 27-06-2003, 10:44 PM   #5
Phil Jones
Guest
 
Posts: n/a
Default Re: BinaryFormatter Alternatives with limitied security priviledges

Here's some code:


REM -- Setup initial conditions.
Dim myThingToStore As New ArrayList
myThingToStore.Add("My Name")

REM -- Get the isolated storage file.
Dim fileName As String = "WebStorage.bin"
Dim isoStore As IsolatedStorageFile
Dim oFile As New IsolatedStorageFileStream( _
fileName, FileMode.Create, isoStore)

REM -- Serialize the stream.
Dim oFormatter As New Formatters.Binary.BinaryFormatter
oFormatter.Serialize(oFile, myThingToStore)
oFile.Close()


This will work if executed from the local machine, but will fail at the
"Serialize" call if run from the Internet ("Low" security priveledge).

Basically I want to cache object state between instances of a Forms app that
is executing within the "NTD" model (hence the need to use IsolatedStorage).

Any ideas for a work around? Thanks....

--
Phil
New Zealand (Aotearoa)



  Reply With Quote
Old 29-06-2003, 01:58 PM   #6
Duke Sun
Guest
 
Posts: n/a
Default Re: BinaryFormatter Alternatives with limitied security priviledges

OK, I got it. I will update you as soon as possible.

  Reply With Quote
Old 30-06-2003, 10:10 AM   #7
Duke Sun
Guest
 
Posts: n/a
Default Re: BinaryFormatter Alternatives with limitied security priviledges

The following should be of assistance:

.NET Zero Deployment
Security and Versioning Models in the Windows Forms Engine Help You Create
and Deploy Smart Clients

http://msdn.microsoft.com/msdnmag/i...etSmartClients/

  Reply With Quote
Old 30-06-2003, 11:20 PM   #8
Phil Jones
Guest
 
Posts: n/a
Default Re: BinaryFormatter Alternatives with limitied security priviledges

Cool, thanks Duke, that's really useful.

Cheers,
Phil


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off