views:

201

answers:

1

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();

+1  A: 

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.

Matt F