I use resource files throughout App_GlobalResources.
Why do I need to have the default resource file?
If I have MyResFile.resx (default file) and MyResFile.en-us.resx it's all fine.
If I remove the default file,
开发者_开发问答stuff like <%: Resources.MyResFile.Key%>
from view or Resources.MyResFile.Key; from controller does not work, telling me Resources does not exist in current context.
But I really don't want to have to keep 2 up to date files, I specify my culture in web.config, and thus know it will exist.
Any solutions?
You need the default resource file for when the server can't find a resource file for the requested culture.
If the texts in your default resource file are in American English, you do not need the MyResFile.en-us.resx file at all.
精彩评论