Working with Resource Files on Visual Studio

| No Comments | No TrackBacks

I had an unusual problem recently that took way too long for me to solve. I was trying to add resource files to a Silverlight project for the purposes of future proofing our application to be localizable, and to make maintaining strings like Tooltips easier. However, even while following the official documentation from Microsoft, I couldn’t get the damn thing to work.

Specifically, when I tried to add the Resource file to my Silverlight project (using these instructions), I couldn’t have it generate code. It wouldn’t generate any code, but what’s worse, it didn’t provide an error (or even a warning or message) when it failed.

The problem appears to be that the instructions say to right click on the project and add the Resource file using the normal “Add new…” function of Visual Studio. However, at least on Silverlight projects, these files are not placed under the “Resources” folder like they’re supposed to be. You need to create the Resources folder, and right click on THAT folder when you add the Resource file.

I ended up basically finding this by accident when looking through examples and I finally noticed that these other people all had their resx files in Resource folders, so if you’re having trouble with code-generation of resx files in Visual Studio 2008, just make sure they were in the right location, because you’re not likely to get anything to help you from Visual Studio.

  • StumbleUpon Toolbar Stumble It!

No TrackBacks

TrackBack URL: http://blog.foxxtrot.net/cgi-bin/mt-tb.cgi/380

Leave a comment

About this Entry

This page contains a single entry by Jeff Craig published on December 18, 2009 8:00 AM.

Moonlight Patent Coventant Extended was the previous entry in this blog.

Killing Me Softly....With Fructose? is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Once You Know, You Newegg

μ-updates

  • No Updates!
OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.21-en