简体   繁体   中英

Silverlight with Visual Studio 2010 Isolated Storage Error

I am getting an error when trying to access isolated storage when running a Silverlight unit test project in VS2010.

Test method Silverlight_Binary_Serialization_Tests.SerializationTests.SerializeBytesTest threw exception: System.IO.IsolatedStorage.IsolatedStorageException: Unable to determine application identity of the caller.

Here is the line it is failing on:

private readonly IsolatedStorageFile _store = IsolatedStorageFile.GetUserStoreForApplication();

If there's no actual host for the class library then the unit test won't be able to determine the application store as there's no actual application as such.

Does the code work when referenced from a Silverlight app? If so I'd suggest it's the above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM