简体   繁体   中英

ASP .net application finds local resource files in Web Development server, but not local IIS

When I run the application using the Visual Studio Web Development Server it works fine. However when I run it using local IIS I get the following error:

Any ideas? Thanks!!

The resource class for this page was not found. Please check if the resource file exists and try again. Description: 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.InvalidOperationException: The resource class for this page was not found. Please check if the resource file exists and try again.

Source Error:

Line 81: private void PopulateLanguageList() Line 82: { Line 83: DropDownListLanguage.Items[0].Text = (string)HttpContext.GetLocalResourceObject( Line 84: "\\Default.aspx", SelectLanguage, Thread.CurrentThread.CurrentCulture); Line 85: }

Stack Trace:

[InvalidOperationException: The resource class for this page was not found. Please check if the resource file exists and try again.] System.Web.Compilation.LocalResXResourceProvider.CreateResourceManager() +4038050 System.Web.Compilation.BaseResXResourceProvider.EnsureResourceManager() +23 System.Web.Compilation.BaseResXResourceProvider.GetObject(String resourceKey, CultureInfo culture) +24 System.Web.Compilation.ResourceExpressionBuilder.GetResourceObject(IResourceProvider resourceProvider, String resourceKey, CultureInfo culture, Type objType, String propName) +32 System.Web.HttpContext.GetLocalResourceObject(String virtualPath, String resourceKey, CultureInfo culture) +56 APPortal.Login.PopulateLanguageList() in c:\\inetpub\\wwwroot\\APPortal\\Default.aspx.cs:83 APPortal.Login.Page_Load(Object sender, EventArgs e) in c:\\inetpub\\wwwroot\\APPortal\\Default.aspx.cs:20 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42 System.Web.UI. Control.OnLoad(EventArgs e) +132 System.Web.UI.Control.LoadRecursive() +66 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

我用全球资源替换了本地资源,这似乎解决了我的问题!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM