0
从开发迁移到生产服务器(IIS7 + Windows Server 2008 R2)时,我正面临一个烦人的问题。ASP.NET 2.0无法找到资源对象 - 将网站迁移到承载SharePoint 2007的生产服务器
我们有一个定制的ASP.NET 2.0,它利用不同语言的资源文件。
所有的工作都很好,但是我们的生产服务器也承载了SharePoint 2007,但是发生故障。错误如下。但仅仅为了回答显而易见的问题,在App_GlobalResources目录下的resx中确实存在关键“样式”。
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The resource object with key 'style' was not found.
Source Error:
Line 21: <asp:ContentPlaceHolder ID="HeadContent" runat="server">
Line 22: </asp:ContentPlaceHolder>
Line 23: <link runat="server" id="aa" rel="stylesheet" href='<%$ Resources:applang,style %>'
Line 24: type="text/css" />
Line 25: <style type="text/css">
Source File: /Applications/MyApp/Site.master Line: 23
我们在这里做错了什么?该网站在Classic .NET AppPool(.NET 2.0和Classic)下配置。
当我看到这个错误时,通常是由于有人粘贴来自Outlook的内容并在配置文件中获得“智能引用”。这将是无效的,你会得到解析错误。我会检查是否是这种情况 - 尝试先通过记事本粘贴以确保没有特殊字符通过。 – 2012-03-07 20:23:33