6
votes

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?

1

1 Answers

2
votes

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.