First time ever I am using Resx file. So below steps I did till now.
- Created empty Asp.net Solution.
- Added a Resx file with basic name value content.
Add a web page and in code behind wrote below code:
protected void Page_Load(object sender, EventArgs e) { ResourceManager rm = new ResourceManager("UsingRESX.Resource1", Assembly.GetExecutingAssembly()); String strWebsite = rm.GetString("Website", CultureInfo.CurrentCulture); // here I get the exception String strName = rm.GetString("Name"); form1.InnerText = "Website: " + strWebsite + "--Name: " + strName; }
But when I run the code I get exception as :
Could not find any resources appropriate for the specified
culture or the neutral culture. Make sure "UsingRESX.Resource1.resources"
was correctly embedded or linked into assembly "WebApplication1" at compile
time, or that all the satellite assemblies required are loadable and fully signed.
Tutorial I followed for this exercise: Read Resx FIle
SO solution that I tried: SO Solution