簡體   English   中英

'jquery'不是有效的腳本名稱。 名稱必須以“ .js”結尾

[英]'jquery' is not a valid script name. The name must end in '.js'

我知道這已經被問過一百次了,但是,可惜的是,VS2012中的NuGet錯誤在這里沒有解決方案。
我所做的只是升級到最新的Ajax工具包,結果導致我的網站損壞了。 我嘗試卸載NuGet程序包,然后重新安裝所有程序,但都沒有高興。 我有jQuery,jQueryUI,並且站點構建良好,但是,在運行時,它因該可怕的錯誤而崩潰。 最后添加.js會產生更多錯誤,依此類推。

    <ajaxToolkit:ToolkitScriptManager ID="tksm1" runat="server" EnableViewState="False">
        <Scripts>            
            <asp:ScriptReference Name="jquery" />
            <asp:ScriptReference Name="jquery.ui.combined" />
            <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
            <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
            <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
            <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
            <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
            <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
            <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
            <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
            <asp:ScriptReference Name="WebFormsBundle" />
            <asp:ScriptReference Path="~/Scripts/search.js" />
        </Scripts>
    </ajaxToolkit:ToolkitScriptManager>

據我所知,所有參考文獻均正確指向。

我已經“清理”了解決方案,刪除了bin文件夾等,等等。 我已經復制並粘貼了其他解決方案(不高興)。

版本:Microsoft Visual Studio Professional 2012版本11.0.61030.00更新4 Microsoft.NET Framework版本4.5.51641 Windows 8.1(今天更新)。 我在這里機智-我應該重新安裝VS嗎?

好的-我想出了最輕松的方法。 我恢復了有關站點的備份(創建備份的好主意)。 在將其加載到VS2012中之前,我完全刪除了\\ packages \\文件夾。 然后,我打開了項目,VS還原了\\ packages \\文件夾和所有引用(運氣不好,我發現VS將為您重建內容)。 我仍然有舊版本的jQuery,jQUI,ACTK等,並經過測試以確保一切正常。 這次的解決方案是完全避免使用NuGet GUI(存在某種錯誤,導致無法正確卸載東西)。 我改用命令行,然后鍵入適當的命令以安裝最新版本(這次正確刪除了舊版本)。 我清理並重建了解決方案,現在效果很好。 (無需編輯.config文件)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM