Last post Jan 20, 2010 06:51 AM by HomerJ666
Jan 19, 2010 08:59 AM|HomerJ666|LINK
I am currently localizing my MVC website, using the Html.Encode method.
I've got a global resouce named "Localization" and using it by e.g. <%= Html.Encode(Resources.Localization.FirstName) %>
When compiled and viewing in the browser it works perfectly, but in VS 2008 Developement Edition it marks it red and displays Cannot resolve symbol 'Resources' when hovering it.
Any way to get that to work?
Jan 19, 2010 01:16 PM|ignatandrei|LINK
Stupid question, but maybe... : Are you using ReSharper?
Jan 19, 2010 07:39 PM|ricka6|LINK
>>when hovering it.
Don't hover :-) I've seen this problem before - sometimes rebuild all fixes it. Does your code work on a real IIS server? That's what you really should care about.
Jan 20, 2010 06:51 AM|HomerJ666|LINK
Yes i'm using resharper, and yes it works both on developement server and a real IIS.
I found out the following: The resources generator was the evil thing. It produced a wrong namespace.. i dont know why it worked then though.. i changed it to 'PublicResXFileCodeGenerator' and changed the namespace to application.App_GlobalResources, and
now i use just "Localization.ResourceKey" and everything is fine!