First time ever I am using Resx file. So below steps I did till now.
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
Try adding
var assembly = Assembly.GetExecutingAssembly();
assembly.GetManifestResourceNames();
and set a breakpoint. This will list all the embedded resources. Make sure you have the correct name. Sometimes the resource paths aren't entirely obvious.