ASP .net 应用程序在 Web 开发服务器中找到本地资源文件,但在本地 IIS 中找不到
当我使用 Visual Studio Web 开发服务器运行该应用程序时,它工作正常。但是,当我使用本地 IIS 运行它时,出现以下错误:
有什么想法吗?谢谢!!
找不到该页面的资源类。请检查资源文件是否存在,然后重试。 描述:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。
异常详细信息:System.InvalidOperationException:找不到此页面的资源类。请检查资源文件是否存在,然后重试。
源错误:
第 81 行:private void PopulateLanguageList() 第 82 行:{ 第 83 行:DropDownListLanguage.Items[0].Text = (string)HttpContext.GetLocalResourceObject( 第 84 行: "\Default.aspx", SelectLanguage, Thread.CurrentThread.CurrentCulture); 第 85 行:}
堆栈跟踪:
[InvalidOperationException:找不到此页面的资源类。请检查资源文件是否存在并重试。] System.Web.Compilation.LocalResXResourceProvider.CreateResourceManager() +4038050 System.Web.Compilation.BaseResXResourceProvider.EnsureResourceManager() +23 System.Web.Compilation.BaseResXResourceProvider.GetObject(字符串资源密钥,CultureInfo文化)+24 System.Web.Compilation.ResourceExpressionBuilder.GetResourceObject(IResourceProvider resourceProvider,字符串resourceKey,CultureInfo文化,类型objType,字符串propName)+32 System.Web.HttpContext.GetLocalResourceObject(字符串virtualPath,字符串resourceKey,CultureInfo文化)+56 APPortal.Login.PopulateLanguageList() 在 c:\inetpub\wwwroot\APPortal\Default.aspx.cs:83 APPortal.Login.Page_Load(对象发送者,EventArgs e)位于 c:\inetpub\wwwroot\APPortal\Default.aspx.cs:20 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,对象o,对象t,EventArgs e)+25 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(对象发送者,EventArgs e)+42 System.Web.UI.Control.OnLoad(EventArgs e)+132 System.Web.UI.Control.LoadRecursive() +66 System.Web.UI.Page.ProcessRequestMain(布尔值 includeStagesBeforeAsyncPoint,布尔值 includeStagesAfterAsyncPoint)+2428
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我用全局资源替换了本地资源,这似乎解决了我的问题!
i replaced the local resources with global resources and this seemed to solve my problem!