|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Isolated Storage AccessI have got the following problem: My application references an assembly of a third party library. A class implemented in this assembly stores a file in the Isolated Storage. Unfortunately this class does not implement a method to delete this file. But this is very important for me. I tried to use the method "System.IO.IsolatedStorageFile.GetStore()" to get access to the Isolated Storage of this assembly and call "System.IO.IsolatedStorageFile.DeleteFile()" to remove the file. But calling "GetStore()" gets me in trouble with the security mechanism of the .NET framework. I get the following exception message: "Selected identity type missing in assembly evidence list." Because I never get in contact with evidence / identity and co. before, I have a big problem now. What must I do to get the Isolated Storage of another assembly than the calling one? (The scope of my "GetStore()" call is: "IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly | IsolatedStorageScope.User" .) Regards Dirk Ströker "Dirk Ströker" <dstroe***@kw-software.de> wrote in message Have you tried asking the library provider to add the functionality? It news:eOR5ukeZFHA.3960@TK2MSFTNGP10.phx.gbl... > Hello, > > I have got the following problem: > My application references an assembly of a third party library. A class > implemented in this assembly stores a file in the Isolated Storage. > Unfortunately this class does not implement a method to delete this file. > But this is very important for me. sounds like it would probably be a very reasonable request. > I tried to use the method "System.IO.IsolatedStorageFile.GetStore()" to Which overload of GetStore are you calling and with what arguments?> get > access to the Isolated Storage of this assembly and call > "System.IO.IsolatedStorageFile.DeleteFile()" to remove the file. But > calling > "GetStore()" gets me in trouble with the security mechanism of the .NET > framework. I get the following exception message: > > "Selected identity type missing in assembly evidence list." > Because I never get in contact with evidence / identity and co. before, I For starters, you should ensure that you're using the same scope as the code > have a big problem now. > What must I do to get the Isolated Storage of another assembly than the > calling one? > > (The scope of my "GetStore()" call is: "IsolatedStorageScope.Domain | > IsolatedStorageScope.Assembly | IsolatedStorageScope.User" .) under which the store was created. Have you used a decompiler such as Reflector (http://www.aisto.com/roeder/dotnet/) to verify this? Show quoteHide quote > > Regards > Dirk Ströker > >
Show quote
Hide quote
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> schrieb im Maybe they add this feature but I cannot wait for a new version which willNewsbeitrag news:eIhVxmfZFHA.3648@TK2MSFTNGP14.phx.gbl... > "Dirk Ströker" <dstroe***@kw-software.de> wrote in message > news:eOR5ukeZFHA.3960@TK2MSFTNGP10.phx.gbl... > > Hello, > > > > I have got the following problem: > > My application references an assembly of a third party library. A class > > implemented in this assembly stores a file in the Isolated Storage. > > Unfortunately this class does not implement a method to delete this file. > > But this is very important for me. > > Have you tried asking the library provider to add the functionality? It > sounds like it would probably be a very reasonable request. > be released in a few month because I have to solve the problem now! > My code looks like this:> > I tried to use the method "System.IO.IsolatedStorageFile.GetStore()" to > > get > > access to the Isolated Storage of this assembly and call > > "System.IO.IsolatedStorageFile.DeleteFile()" to remove the file. But > > calling > > "GetStore()" gets me in trouble with the security mechanism of the .NET > > framework. I get the following exception message: > > > > "Selected identity type missing in assembly evidence list." > > Which overload of GetStore are you calling and with what arguments? > Assembly assembly = typeof(MyAssembly.Class1).Assembly; Evidence assemblyEvidence = assembly.Evidence; IsolatedStorageFile isf = IsolatedStorageFile.GetStore(IsolatedStorageScope.Assembly | IsolatedStorageScope.User, AppDomain.CurrentDomain.Evidence.GetType(), assemblyEvidence.GetType()); But I am not sure what I doing here! I have no experience with it! Show quoteHide quote > Yes I checked the scope. It is identical.> > Because I never get in contact with evidence / identity and co. before, I > > have a big problem now. > > What must I do to get the Isolated Storage of another assembly than the > > calling one? > > > > (The scope of my "GetStore()" call is: "IsolatedStorageScope.Domain | > > IsolatedStorageScope.Assembly | IsolatedStorageScope.User" .) > > For starters, you should ensure that you're using the same scope as the code > under which the store was created. Have you used a decompiler such as > Reflector (http://www.aisto.com/roeder/dotnet/) to verify this? > > Dirk> > > > Regards > > Dirk Ströker > > > > > > Since assembly-level scoping is being used, you need to ensure that you're
presenting the same assembly evidence. When the store is created, is the evidence from your assembly or the library assembly being used? Dirk Ströker" <dstroe***@kw-software.de> wrote in message Show quoteHide quote news:ugO3ZG2ZFHA.3144@TK2MSFTNGP12.phx.gbl... > > "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> schrieb im > Newsbeitrag news:eIhVxmfZFHA.3648@TK2MSFTNGP14.phx.gbl... >> "Dirk Ströker" <dstroe***@kw-software.de> wrote in message >> news:eOR5ukeZFHA.3960@TK2MSFTNGP10.phx.gbl... >> > Hello, >> > >> > I have got the following problem: >> > My application references an assembly of a third party library. A class >> > implemented in this assembly stores a file in the Isolated Storage. >> > Unfortunately this class does not implement a method to delete this > file. >> > But this is very important for me. >> >> Have you tried asking the library provider to add the functionality? It >> sounds like it would probably be a very reasonable request. >> > > Maybe they add this feature but I cannot wait for a new version which will > be released in a few month because I have to solve the problem now! > >> >> > I tried to use the method "System.IO.IsolatedStorageFile.GetStore()" to >> > get >> > access to the Isolated Storage of this assembly and call >> > "System.IO.IsolatedStorageFile.DeleteFile()" to remove the file. But >> > calling >> > "GetStore()" gets me in trouble with the security mechanism of the .NET >> > framework. I get the following exception message: >> > >> > "Selected identity type missing in assembly evidence list." >> >> Which overload of GetStore are you calling and with what arguments? >> > > My code looks like this: > > Assembly assembly = typeof(MyAssembly.Class1).Assembly; > Evidence assemblyEvidence = assembly.Evidence; > IsolatedStorageFile isf = > IsolatedStorageFile.GetStore(IsolatedStorageScope.Assembly | > IsolatedStorageScope.User, AppDomain.CurrentDomain.Evidence.GetType(), > assemblyEvidence.GetType()); > > But I am not sure what I doing here! I have no experience with it! > >> >> > Because I never get in contact with evidence / identity and co. before, > I >> > have a big problem now. >> > What must I do to get the Isolated Storage of another assembly than the >> > calling one? >> > >> > (The scope of my "GetStore()" call is: "IsolatedStorageScope.Domain | >> > IsolatedStorageScope.Assembly | IsolatedStorageScope.User" .) >> >> For starters, you should ensure that you're using the same scope as the > code >> under which the store was created. Have you used a decompiler such as >> Reflector (http://www.aisto.com/roeder/dotnet/) to verify this? >> > > Yes I checked the scope. It is identical. > >> >> > >> > Regards >> > Dirk Ströker >> > >> > >> >> > > Dirk > > The library gets the store using the following line:
IsolatedStorageFile.GetStore(IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly | IsolatedStorageScope.User, null, null); Show quoteHide quote "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> schrieb im Newsbeitrag news:efrupVGaFHA.1040@TK2MSFTNGP10.phx.gbl... > Since assembly-level scoping is being used, you need to ensure that you're > presenting the same assembly evidence. When the store is created, is the > evidence from your assembly or the library assembly being used? > > > Dirk Ströker" <dstroe***@kw-software.de> wrote in message > news:ugO3ZG2ZFHA.3144@TK2MSFTNGP12.phx.gbl... > > > > "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> schrieb im > > Newsbeitrag news:eIhVxmfZFHA.3648@TK2MSFTNGP14.phx.gbl... > >> "Dirk Ströker" <dstroe***@kw-software.de> wrote in message > >> news:eOR5ukeZFHA.3960@TK2MSFTNGP10.phx.gbl... > >> > Hello, > >> > > >> > I have got the following problem: > >> > My application references an assembly of a third party library. A class > >> > implemented in this assembly stores a file in the Isolated Storage. > >> > Unfortunately this class does not implement a method to delete this > > file. > >> > But this is very important for me. > >> > >> Have you tried asking the library provider to add the functionality? It > >> sounds like it would probably be a very reasonable request. > >> > > > > Maybe they add this feature but I cannot wait for a new version which will > > be released in a few month because I have to solve the problem now! > > > >> > >> > I tried to use the method "System.IO.IsolatedStorageFile.GetStore()" to > >> > get > >> > access to the Isolated Storage of this assembly and call > >> > "System.IO.IsolatedStorageFile.DeleteFile()" to remove the file. But > >> > calling > >> > "GetStore()" gets me in trouble with the security mechanism of the ..NET > >> > framework. I get the following exception message: > >> > > >> > "Selected identity type missing in assembly evidence list." > >> > >> Which overload of GetStore are you calling and with what arguments? > >> > > > > My code looks like this: > > > > Assembly assembly = typeof(MyAssembly.Class1).Assembly; > > Evidence assemblyEvidence = assembly.Evidence; > > IsolatedStorageFile isf = > > IsolatedStorageFile.GetStore(IsolatedStorageScope.Assembly | > > IsolatedStorageScope.User, AppDomain.CurrentDomain.Evidence.GetType(), > > assemblyEvidence.GetType()); > > > > But I am not sure what I doing here! I have no experience with it! > > > >> > >> > Because I never get in contact with evidence / identity and co. before, > > I > >> > have a big problem now. > >> > What must I do to get the Isolated Storage of another assembly than the > >> > calling one? > >> > > >> > (The scope of my "GetStore()" call is: "IsolatedStorageScope.Domain | > >> > IsolatedStorageScope.Assembly | IsolatedStorageScope.User" .) > >> > >> For starters, you should ensure that you're using the same scope as the > > code > >> under which the store was created. Have you used a decompiler such as > >> Reflector (http://www.aisto.com/roeder/dotnet/) to verify this? > >> > > > > Yes I checked the scope. It is identical. > > > >> > >> > > >> > Regards > >> > Dirk Ströker > >> > > >> > > >> > >> > > > > Dirk > > > > > > In that case, you should be able to retrieve the library store using the
following call: IsolatedStorageFile.GetStore(IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly | IsolatedStorageScope.User, typeof(SomeTypeInYourExecutable).Assembly.Evidence, null, typeof(SomeTypeInTheLibrary).Assembly.Evidence, null) Show quoteHide quote "Dirk Ströker" <dstroe***@kw-software.de> wrote in message news:%23nITuuoaFHA.3040@TK2MSFTNGP14.phx.gbl... > The library gets the store using the following line: > > IsolatedStorageFile.GetStore(IsolatedStorageScope.Domain | > IsolatedStorageScope.Assembly | IsolatedStorageScope.User, null, null); > > > "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> schrieb im > Newsbeitrag news:efrupVGaFHA.1040@TK2MSFTNGP10.phx.gbl... >> Since assembly-level scoping is being used, you need to ensure that >> you're >> presenting the same assembly evidence. When the store is created, is the >> evidence from your assembly or the library assembly being used? >> >> >> Dirk Ströker" <dstroe***@kw-software.de> wrote in message >> news:ugO3ZG2ZFHA.3144@TK2MSFTNGP12.phx.gbl... >> > >> > "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> schrieb im >> > Newsbeitrag news:eIhVxmfZFHA.3648@TK2MSFTNGP14.phx.gbl... >> >> "Dirk Ströker" <dstroe***@kw-software.de> wrote in message >> >> news:eOR5ukeZFHA.3960@TK2MSFTNGP10.phx.gbl... >> >> > Hello, >> >> > >> >> > I have got the following problem: >> >> > My application references an assembly of a third party library. A > class >> >> > implemented in this assembly stores a file in the Isolated Storage. >> >> > Unfortunately this class does not implement a method to delete this >> > file. >> >> > But this is very important for me. >> >> >> >> Have you tried asking the library provider to add the functionality? > It >> >> sounds like it would probably be a very reasonable request. >> >> >> > >> > Maybe they add this feature but I cannot wait for a new version which > will >> > be released in a few month because I have to solve the problem now! >> > >> >> >> >> > I tried to use the method "System.IO.IsolatedStorageFile.GetStore()" > to >> >> > get >> >> > access to the Isolated Storage of this assembly and call >> >> > "System.IO.IsolatedStorageFile.DeleteFile()" to remove the file. But >> >> > calling >> >> > "GetStore()" gets me in trouble with the security mechanism of the > .NET >> >> > framework. I get the following exception message: >> >> > >> >> > "Selected identity type missing in assembly evidence list." >> >> >> >> Which overload of GetStore are you calling and with what arguments? >> >> >> > >> > My code looks like this: >> > >> > Assembly assembly = typeof(MyAssembly.Class1).Assembly; >> > Evidence assemblyEvidence = assembly.Evidence; >> > IsolatedStorageFile isf = >> > IsolatedStorageFile.GetStore(IsolatedStorageScope.Assembly | >> > IsolatedStorageScope.User, AppDomain.CurrentDomain.Evidence.GetType(), >> > assemblyEvidence.GetType()); >> > >> > But I am not sure what I doing here! I have no experience with it! >> > >> >> >> >> > Because I never get in contact with evidence / identity and co. > before, >> > I >> >> > have a big problem now. >> >> > What must I do to get the Isolated Storage of another assembly than > the >> >> > calling one? >> >> > >> >> > (The scope of my "GetStore()" call is: "IsolatedStorageScope.Domain >> >> > | >> >> > IsolatedStorageScope.Assembly | IsolatedStorageScope.User" .) >> >> >> >> For starters, you should ensure that you're using the same scope as >> >> the >> > code >> >> under which the store was created. Have you used a decompiler such as >> >> Reflector (http://www.aisto.com/roeder/dotnet/) to verify this? >> >> >> > >> > Yes I checked the scope. It is identical. >> > >> >> >> >> > >> >> > Regards >> >> > Dirk Ströker >> >> > >> >> > >> >> >> >> >> > >> > Dirk >> > >> > >> >> > > Hello Dirk,
you can also manipulate the store using the storeadm.exe command line tool --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > Hello, > > I have got the following problem: > My application references an assembly of a third party library. A > class > implemented in this assembly stores a file in the Isolated Storage. > Unfortunately this class does not implement a method to delete this > file. > But this is very important for me. > I tried to use the method "System.IO.IsolatedStorageFile.GetStore()" > to get access to the Isolated Storage of this assembly and call > "System.IO.IsolatedStorageFile.DeleteFile()" to remove the file. But > calling "GetStore()" gets me in trouble with the security mechanism of > the .NET framework. I get the following exception message: > > "Selected identity type missing in assembly evidence list." > > Because I never get in contact with evidence / identity and co. > before, I > have a big problem now. > What must I do to get the Isolated Storage of another assembly than > the > calling one? > (The scope of my "GetStore()" call is: "IsolatedStorageScope.Domain | > IsolatedStorageScope.Assembly | IsolatedStorageScope.User" .) > > Regards > Dirk Ströker Hello Dominick,
using the storeadm.exe tool removes ALL stores of a user and not a specific one. Dirk Show quoteHide quote "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com> schrieb im Newsbeitrag news:427888632531568248901536@news.microsoft.com... > Hello Dirk, > > you can also manipulate the store using the storeadm.exe command line tool > > --------------------------------------- > Dominick Baier - DevelopMentor > http://www.leastprivilege.com > > > Hello, > > > > I have got the following problem: > > My application references an assembly of a third party library. A > > class > > implemented in this assembly stores a file in the Isolated Storage. > > Unfortunately this class does not implement a method to delete this > > file. > > But this is very important for me. > > I tried to use the method "System.IO.IsolatedStorageFile.GetStore()" > > to get access to the Isolated Storage of this assembly and call > > "System.IO.IsolatedStorageFile.DeleteFile()" to remove the file. But > > calling "GetStore()" gets me in trouble with the security mechanism of > > the .NET framework. I get the following exception message: > > > > "Selected identity type missing in assembly evidence list." > > > > Because I never get in contact with evidence / identity and co. > > before, I > > have a big problem now. > > What must I do to get the Isolated Storage of another assembly than > > the > > calling one? > > (The scope of my "GetStore()" call is: "IsolatedStorageScope.Domain | > > IsolatedStorageScope.Assembly | IsolatedStorageScope.User" .) > > > > Regards > > Dirk Ströker > > > |
|||||||||||||||||||||||