NUGET软件包更新后项目失败

时间:2018-08-06 16:39:02

标签: c# asp.net visual-studio nuget nuget-package

使用NUGET更新依赖项会在应用程序中产生错误。

从Visual Studio Community 2017中为C#和Web窗体创建一个带有母版页的新项目。在Visual Studio中成功运行网站后,我更新了项目,发现需要更新24个nuget程序包。

好吧,更新软件包。全部24,然后按照说明重新启动Visual Studio。

重新加载项目并运行,出现编译错误,项目无法运行或无法完成加载。

此编译错误是新的,之前我失去了与twitter / bootstrap和jquery文件的连接。我通过删除脚本和捆绑管理器中的引用来解决了这些问题。

现在,它只是杀死了新的应用程序模板。没有编程,只是基本模板无法加载。当它确实销毁了大多数引导程序和jquery例程并破坏了导航菜单布局时。

这是编译错误:

  

C:\ Program Files(x86)\ IIS> Express> C:\ Users \ michaelw.DEESIGN \ Documents \ Visual Studio> 2017 \ Projects \ WebSite2 \ WebSite2 \ bin \ roslyn \ csc.exe / t:library> / utf8output / nostdlib +> /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll“> / R:” C:\ WINDOWS \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Runtime \ v4.0_4.0.0.0__b03f5f7f11d50a3a \ System.Runtime.dll“> / R:” C:\ WINDOWS \ Microsoft.Net \ assembly \ GAC_MSIL \ Microsoft.VisualStudio.Web.PageInspector.Loader \ v4.0_1.0.0.0__b03f5f7f11d50a3a \ Microsoft.VisualStudio.Web.PageInspector.Loader.dll” / R:“ C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ c9841997 \ 00b21bea_1de6d301 \ AspNet.ScriptManager.bootstrap.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 2c48699e \ 0011ed8c_808dce \ Microsoft.AspNet.FriendlyUrls.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ ca8 8605b \ 00cb5b40_b9c3d301 \ Newtonsoft.Json.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll”> / R: “ C:\ WINDOWS \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Activities \ v4.0_4.0.0.0__31bf3856ad364e35 \ System.Activities.dll”> / R:“ C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET>文件\ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 0f5ed648 \ 00720de7_d9cccd01 \ Owin.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP。 NET>文件\ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ ed6e8f5b \ 008a9d1a_f395d301 \ AspNet.ScriptManager.jQuery.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP.NET >文件\ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ c5b71904 \ 002397f9_6c18cf01 \ WebGrease.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a \ System.Configuration.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ d l3 \ 7cb43f83 \ 00d0a76d_64aece01 \ Antlr3.Runtime.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices。 dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 6a7a0b6e \ 001e1df5_ebdbd301 \ Microsoft.AspNet.Identity.Owin .dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll”> / R:“ C: \ WINDOWS \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Xml.Linq \ v4.0_4.0.0.0__b77a5c561934e089 \ System.Xml.Linq.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local \ Temp \ Temporary ASP.NET>文件\ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 3cbaac25 \ 00f1ebf3_ebdbd301 \ Microsoft.AspNet.Identity.Core.dll“> / R:” C:\ Users \ michaelw.DEESIGN \ AppData \本地\临时\临时ASP.NET>文件\ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ de563d64 \ 0097c37f_224cd301 \ EntityFramework.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_32 \ System.Web \ v4.0_4.0.0.0__b03f5f7f11d50a3a \ System.Web.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Web.Infrastructure\v4.0_1.0.0.0__31bf3856ad364e35 \ Microsoft.Web.Infrastructure.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll”> / R:“ C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 713924f7 \ 00c4f480_224cd301 \ EntityFramework.SqlServer.dll“> / R:” C:\用户\ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET>文件\ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ e60bcda8 \ 00939497_11a5d301 \ Microsoft.Owin.Security.Twitter.dll“> / R:” C: \ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 4fffbea8 \ 00dfcf92_11a5d301 \ Microsoft.Owin.Security.Google.dll“> / R:” C :\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ mscorlib.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e08 9 \ System.Runtime.Serialization.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll” > /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll“> / R:” C:\ WINDOWS \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Core \ v4.0_4.0.0.0__b77a5c561934e089 \ System.Core.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4。 0.0.0__b03f5f7f11d50a3a \ System.Web.Services.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions。 dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.WebRequest\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.WebRequest.dll”> / R: “ C:\ WINDOWS \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Web.Extensions \ v4.0_4.0.0.0__31bf3856ad364e35 \ System.Web.Extensions.dll”> / R:“ C:\ WINDOWS \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Web.Dyn amicData \ v4.0_4.0.0.0__31bf3856ad364e35 \ System.Web.DynamicData.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System。 Drawing.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll”> / R:“ C :\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ fb841881 \ 00dfcf92_11a5d301 \ Microsoft.Owin.Security.Facebook.dll“> / R:” C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 442f60b0 \ 00583c8f_11a5d301 \ Microsoft.Owin.Security.dll“> / R:” C :\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 56334a44 \ 0052dd57_a7e7ce01 \ System.Web.Providers.dll“> / R:” C: \ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 3f088bba \ 00393295_11a5d301 \ Microsoft.Owin.Security.M icrosoftAccount.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll”> / R:“ C:\ WINDOWS \ Microsoft.Net \ assembly \ GAC_32 \ System.EnterpriseServices \ v4.0_4.0.0.0__b03f5f7f11d50a3a \ System.EnterpriseServices.dll”> / R:“ C:\ WINDOWS \ Microsoft.Net \ assembly \ GAC_MSIL \ System.ServiceModel \ v4.0_4.0.0.0__b77a5c561934e089 \ System.ServiceModel.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ e1ab0c9e \ 00e6fa3f_7827cf01 \ Microsoft.AspNet.Web.Optimization.WebForms.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 3b868cfc \ 00b29e91_11a5d301 \ Microsoft.Owin.Security.Cookies.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP.NET>文件\ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ e9625208 \ 00e6fa3f_7827cf01 \ System.Web.Optimization.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Loca l \ Temp \ Temporary ASP.NET>文件\ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 11064a60 \ 00666396_11a5d301 \ Microsoft.Owin.Security.OAuth.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly \ GAC_MSIL \ System \ v4.0_4.0.0.0__b77a5c561934e089 \ System.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ a6149561 \ 00fbad02_86f3d301 \ Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ aa9c70b3 \ 00fed98c_11a5d301 \ Microsoft.Owin.Host.SystemWeb.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35 \ System.ComponentModel.DataAnnotations.dll“> /R:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp\Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ cb06e281 \ 004a1588_11a5d301 \ Microsoft.Owin.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7 f11d50a3a \ System.Net.Http.dll“> /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll”> / R: “ C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 3101006c \ 00d6d5b9_2dabce01 \ Microsoft.ScriptManager.MSAjax.dll”> / R: C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ 4f6eecce \ 00b7cbbf_2dabce01 \ Microsoft.ScriptManager.WebForms.dll“> / R:” C :\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET>文件\ vs \ 732bd14c \ 5c4cc4da \ assembly \ dl3 \ d9915d1f \ 001e1df5_ebdbd301 \ Microsoft.AspNet.Identity.EntityFramework.dll“> / R:” C:\ WINDOWS \ Microsoft.Net \ assembly \ GAC_MSIL \ Microsoft.CSharp \ v4.0_4.0.0.0__b03f5f7f11d50a3a \ Microsoft.CSharp.dll“> /out:"C:\Users\michaelw.DEESIGN\AppData\Local\Temp \ Temporary ASP.NET>文件\ vs \ 732bd14c \ 5c4cc4da \ App_Code.clskvtg9.dll“ / D:DEBUG / debug +> / optimize- / warnaserror- / w:4 / nowarn:16 59; 1699; 1701; 612; 618> / langversion:默认/ nowarn:1659; 1699; 1701>“ C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ App_Code.clskvtg9.0.cs“>” C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ App_Code.clskvtg9.1.cs“>” C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ App_Code.clskvtg9.2.cs“>” C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET>文件\ vs \ 732bd14c \ 5c4cc4da \ App_Code.clskvtg9.3.cs“>” C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ App_Code.clskvtg9.4.cs“>” C:\ Users \ michaelw.DEESIGN \ AppData \ Local \ Temp \ Temporary ASP.NET> Files \ vs \ 732bd14c \ 5c4cc4da \ App_Code.clskvtg9.5.cs“

所有这些都来自在Nuget中刚刚“更新”的基本模板。

1)有人可以告诉我出了什么问题吗?以及如何正确解决问题。

1a)有人可以告诉我应该如何使用bundles和scriptmanager加载jQuery和Bootstrap吗?

2)软件包更新杀死项目或破坏以前的工作是否很常见?

3)将来是否有办法使“更新”正确运行?

谢谢您的输入。

1 个答案:

答案 0 :(得分:1)

  

1)有人可以告诉我出了什么问题吗?以及如何正确解决问题。

您应使用NuGet Package Manager UI更新这些nuget软件包,更新标签会显示具有更高版本的软件包。您可以选中复选框Select all packages,然后单击update按钮以更新所有软件包。

enter image description here

通过这种方式,NuGet将检查依赖项兼容性,如果在更新过程中出现任何问题,NuGet将还原软件包更新。而且,您可以在输出窗口中查看日志,以查找更新失败的原因。或者,我们也可以一个一个地更新那些软件包,检查日志中是否存在兼容性问题。

  

2)软件包更新杀死项目或破坏项目是常见的吗?   以前在工作吗?

否,但是更新包通常会破坏以前的工作。那是因为每个程序包都有自己的依赖性和其他限制。当我们更新其中一个程序包时,NuGet将更新其依赖关系,但是如果其他程序包依赖于旧的依赖关系,则它将破坏以前的工作方式。但是正如我上面所说,当您在大多数情况下在Visual Studio中更新软件包时,NuGet会在输出窗口中给出警告/错误信息,而NuGet会还原该软件包的更新。

  

3)将来是否有办法使“更新”正确运行?

如果以上两个问题解决了您的问题,则无需回答此问题。如果以上无法解决您的问题,请给我一些步骤,如何更新nuget软件包,我将继续关注。

希望这会有所帮助。