1

我知道这已经被问过一百次了,但是很遗憾,这里没有解决方案可以解决 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吗?

4

1 回答 1

0

好的 - 我想出了最轻松的方法。我恢复了相关站点的备份(进行备份的好主意)。在将其加载到 VS2012 之前,我完全删除了 \packages\ 文件夹。然后,我打开了项目,VS 恢复了 \packages\ 文件夹和所有引用(运气不好,我发现 VS 会为你重建东西)。我仍然拥有旧版本的 jQuery、jQUI、ACTK 等,并进行了测试以确保一切正常。这次的解决方案是完全避免使用 NuGet GUI(存在某种错误,它不会正确卸载东西)。我改为转到命令行并输入适当的命令来安装最新版本(这次旧版本已正确删除)。我清理并重建了解决方案,现在它工作得很好。(无需编辑 .config 文件)。

于 2014-04-09T23:52:09.660 回答