Search code examples
asp.net-mvcasp.net-mvc-3resx

Cannot view resx file designer Visual Studio


I have a .resx file in my ASP.NET MVC 3 application and there's code in there that generates resources on the fly using the ResXResourceReader class. It's all been working fine but there was a bug that created some resources with a space in the keys, which Visual Studio obviously didn't like. I've removed them now and fixed the bug but now I can't open the resx file in the Designer at all. All I get is a red cross and the word "name".

I tried parsing the resx using Notepad++'s XML Tools and that didn't throw up an error, I used our resource service class to iterate through all the keys and none of them have any spaces and all data tags are closed correctly.

I couldn't find any similar issues and I'm stuck as to what could be wrong with my resx file. I'm not sure if it's still somehow invalid or it has just got corrupted or something. Does anyone have any ideas?


Solution

  • I had a similar issue recently. Have you made sure that there isn't a property with any empty key in your resource file?

    <data name="" xml:space="preserve">
       <value></value>
    </data>