Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Signing breaks Isolated Storage

I'm using Isolated Storage via the IsolatedStorageFile.GetMachineStoreForAssembly() method to store my application settings.

After my application was already deployed, I bought a digital certificate to sign my software with. However, the new version with the certificate cannot read the old settings file. Presumbly this is because the signing changed the application identity.

How can I access the old settings, which were written from the old version (which was unsigned)? Is it possible to somehow get the Machine store of the old assembly by passing in the old identity?

like image 364
LTR Avatar asked Jun 23 '13 20:06

LTR


1 Answers

The machine store is identified by application identity, not just name.
Your publicKeyToken would be different after you signed your code.

References:
http://msdn.microsoft.com/en-US/library/system.io.isolatedstorage.isolatedstoragefile.getmachinestoreforassembly(v=vs.80).aspx http://msdn.microsoft.com/en-us/library/b0yt6ck0.aspx

  • Edit -
    This is one of the down sides of isolated storage. I don't use it for permanent settings, that cannot be reentered if necessary. For longer term storage I create a folder for my app under the ApplicationData folder Environment.GetFolderPath(ApplicationData) and store my files there.

That being said, I found this article that can sometimes be used to locate the folder, if you know the name of a file.

like image 54
Brad Bruce Avatar answered Nov 04 '22 06:11

Brad Bruce