I have resources in MyPage.resx file. Resource has BuildAction: Embedded Resource.
I load it like this
var rm = new ResourceManager("MyApp.Web.App_LocalResources.MyPage.aspx", Assembly.GetExecutingAssembly());
RadWindow1.Title = rm.GetString("MyResource");
It is loaded ok, when you load it in Debug build. But, when you load it in Release build it gives you error:
System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "MyApp.Web.App_LocalResources.MyPage.aspx.resources" was correctly embedded or linked into assembly "App_LocalResources.root.aakngnnt" at compile time, or that all the satellite assemblies required are loadable and fully signed.
I've tried to change BuildAction to "Content", but then I get this error in Debug build also.
Error happens on this line in master page, But I'm sure, this line is ok:
<input type="hidden" id="browser" class="<%=Request.Browser.Browser + Request.Browser.MajorVersion%>" />
Call Stack:
[MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "MyPage.aspx.resources" was correctly embedded or linked into assembly "App_LocalResources.root.dldzdmsy" at compile time, or that all the satellite assemblies required are loadable and fully signed.] System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName) +441 System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark) +1219 System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark) +1008 System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +43 System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream) +591 System.Web.Compilation.ResourceExpressionBuilder.GetResourceObject(IResourceProvider resourceProvider, String resourceKey, CultureInfo culture, Type objType, String propName) +33 ASP.mypage_aspx.__RenderContent1(HtmlTextWriter __w, Control parameterContainer) +282 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80 ASP.masterpage_master.__Renderform1(HtmlTextWriter __w, Control parameterContainer) in System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +11661287 System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80 System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53 ASP.masterpage_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\myapp\fd8c86aa\81836916\App_Web_masterpage.master.cdcab7d2.tzvi75g-.0.cs:0 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169 System.Web.UI.Page.Render(HtmlTextWriter writer) +40 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239
How can I fix this?
This happened because of calling
caption = <%= GetLocalResourceObject("MyResource.Text") %>;
in aspx in js section.
Yes, its strange, but this is how it happens.