Last post Jul 17, 2007 01:32 AM by gratisaccount
Jul 16, 2007 11:37 AM|gratisaccount|LINK
I want to access satellite assembly through below code. But every time it gives me the following error:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details:
System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture.
Make sure "MyRes02.Res.hi-IN.resources" was correctly embedded or linked into assembly "App_Web_np6wjg1a" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Please tell me why I am getting this error. I have tried various method for resource generation & assembly Linking.
But could't access the assembly.
It works well if I access the resource file directly.
One thing more Please tell me, that When I put my resx file under "App_globalResources" It gives me error but when I put the ".Resex" outside the "App_gloabalResource" folder It works.
Why it behaves so.
1 using System;
public partial class _Default : System.Web.UI.Page
private CultureInfo CI;
private CultureInfo CI1;
protected void Page_Load(object sender, EventArgs e)
private void getCultureInfo(string cultureName)
CI = new CultureInfo(cultureName);
Thread.CurrentThread.CurrentCulture = CI;
private void DisplayResourceInfo(string culName)
CI1 = new CultureInfo(culName);
Thread.CurrentThread.CurrentUICulture = CI1;
string FullCulName = "MyRes02.Res." + culName;
//ResourceManager RM = ResourceManager.CreateFileBasedResourceManager(FullCulName, Server.MapPath("App_GlobalResources"), null);
ResourceManager RM = new ResourceManager(FullCulName, Assembly.GetExecutingAssembly());
Label1.Text = RM.GetString("String1", CI1);
Jul 16, 2007 02:09 PM|rstrahl|LINK
You shouldn't use a ResourceManager in ASP.NET because ASP.NET has its own mechanism for retrieving resources via a ResourceProvider.
Label1.Text = HttpContext.GetGlobalResourceObject("Resources","String1") as string;
instead where Resources is the name of a resource file in APP_GlobalResources.
For that matter if you're assigning to a control look into using either Explicit or Implicit Resource Expressions.
+++ Rick ---
Jul 17, 2007 01:32 AM|gratisaccount|LINK
Hi Thanks for your reply,
But can you please explian it.
I mean in many tutorials on net I have seen them using ResourceManager.
I also tried per your instrutions. but it didn't worked.