ASP .net 应用程序在 Web 开发服务器中找到本地资源文件,但在本地 IIS 中找不到

发布于 2024-09-24 11:13:55 字数 1664 浏览 5 评论 0原文

当我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

画骨成沙 2024-10-01 11:13:55

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

i replaced the local resources with global resources and this seemed to solve my problem!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文