Monthly Archives: February 2013

WP8: Linq to Sql MissingManifestResourceException

I was making a major overhaul of a windows phone 8 application yet to be released. It was my own fault, I made a lot of changes in a short time. I did make sure all my tests still passed. Running the application in the emulator gave me a MissingManifestResourceException. I never had this problem before. The error would occur in the base constructor for the DataContext.

The full error message was:
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Microsoft.Phone.Data.Resources.resources" was correctly embedded or linked into assembly "Microsoft.Phone.Data.Internal" at compile time, or that all the satellite assemblies required are loadable and fully signed.

I did the usual checks for Neutral Language setting in the Assembly Information. I made sure the Supported Cultures were correct. I added a resource file to the project. I thought maybe the template I had used to create the app didn’t include the appropriate resource file. Still nothing.

I couldn’t find anything that would confirm or deny the fact that linq to sql required cultural resource files.

After much thrashing, I found the cause of my issue. It was in the connection string. Can you see the problem?
"Data Source=isostore;/children.sdf"

It’s the semi-colon. The connection string should have been:
"Data Source=isostore:/children.sdf"
My typo in the connection string gave me an obscure error which lead me on a wild goose chase down the wrong path.

So, lesson learned. Always double check you are using a colon ":" in your connection string.