jamesmontemagno / SettingsPlugin

Read and Write Settings Plugin for Xamarin and Windows
MIT License
324 stars 80 forks source link

Potential different .NET 4.5 apps can override/damage settings of each other #74

Closed netsrotr closed 7 years ago

netsrotr commented 7 years ago

Within the settings implementation of "src/Plugin.Settings.Net45/Settings.cs" you use the framework function "IsolatedStorageFile.GetUserStoreForAssembly()" to get the isolated storage settings target. According to the .NET docs this may cause issues because if one use your .NET implementation assembly within different applications will always uses the same isolated store when using this method (see remarks section). Maybe it is better to use the call .GetUserStoreForDomain() to separate settings of different apps using the same (your) impl. assembly.

What do you think?

jamesmontemagno commented 7 years ago

Are you sure?

It says: Different assemblies running within the same application domain always have distinct isolated stores.

always have distinct... @Clancey implemented it

netsrotr commented 7 years ago

Yes, different assemblies. But if one use -> your <- implementation (dll/assembly) in different apps it is always the same assembly: -> your <- assembly implementing the Store access. If -> I am <- call the method at Store in different assemblies, I will have distinct stores, yes.

Clancey commented 7 years ago

Yes, you seem correct. You should send a pull request changing it to GetUserStoreForApplication Method ()

jamesmontemagno commented 7 years ago

Ahhhh interesting :) good one, the wording is very strange on there :) will change in the next v3 change.