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?
Cheerio,
Thomas
Please check Mark as answer if my post assisted you and earn a free point! :)
Kind regards,
Thomas Reichhart Neunkirchen, Austria
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.
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!
thank you!
thomas
Please check Mark as answer if my post assisted you and earn a free point! :)
Kind regards,
Thomas Reichhart Neunkirchen, Austria
Marked as answer by HomerJ666 on Jan 20, 2010 06:52 AM
HomerJ666
Member
410 Points
101 Posts
Cannot resolve symbol 'Resources'
Jan 19, 2010 08:59 AM|LINK
Hello fellows!
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?
Cheerio,
Thomas
Kind regards,
Thomas Reichhart
Neunkirchen, Austria
ignatandrei
All-Star
135174 Points
21682 Posts
Moderator
MVP
Re: Cannot resolve symbol 'Resources'
Jan 19, 2010 01:16 PM|LINK
Stupid question, but maybe... : Are you using ReSharper?
ricka6
All-Star
15070 Points
2272 Posts
Microsoft
Moderator
Re: Cannot resolve symbol 'Resources'
Jan 19, 2010 07:39 PM|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.
HomerJ666
Member
410 Points
101 Posts
Re: Cannot resolve symbol 'Resources'
Jan 20, 2010 06:51 AM|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!
thank you!
thomas
Kind regards,
Thomas Reichhart
Neunkirchen, Austria