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