asp.net-mvc – 与Microsoft HTTP Client Libraries v2.1.10相关
注意:这个问题在最初发布后几天完全被重写。
我有一个在VS 2012开发的ASP.NET MVC应用程序,部署到Azure。原始项目是从ASP.NET MVC 4项目模板创建的。 NuGet最近开始显示来自微软的大量更新的软件包。 Microsoft HTTP Client Libraries v2.1.10中的其中一个更新会在安装时导致严重的问题。 >它安装MicrosoftBcl.Build,这与我的Azure项目不兼容(有关问题及其解决方案,请参阅this SO question)。 这引发了几个灼热的问题: >我的MVC应用程序只是一个网站。它只是运行在一个网络浏览器。我需要这个包吗(例如,是否使用模板代码,如果我删除包,它会破坏,可能会巧妙)? 在安装更新的NuGet软件包之后,在构建解决方案时,会发出以下警告: 1>------ Build started: Project: Ruby,Configuration: Release Any CPU ------ 1> All packages listed in packages.config are already installed. 1> No way to resolve conflict between "System.Web.Mvc,Version=3.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35" and "System.Web.Mvc,Version=1.0.0.0,PublicKeyToken=31bf3856ad364e35". Choosing "System.Web.Mvc,PublicKeyToken=31bf3856ad364e35" arbitrarily. 1> Consider app.config remapping of assembly "DotNetOpenAuth.AspNet,PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesDotNetOpenAuth.AspNet.4.3.0.13117libnet45-fullDotNetOpenAuth.AspNet.dll] to solve conflict and get rid of warning. 1> Consider app.config remapping of assembly "System.Web.Mvc,PublicKeyToken=31bf3856ad364e35" from Version "3.0.0.0" [C:Program Files (x86)Microsoft ASP.NETASP.NET MVC 3AssembliesSystem.Web.Mvc.dll] to Version "4.0.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.AspNet.Mvc.4.0.30506.0libnet40System.Web.Mvc.dll] to solve conflict and get rid of warning. 1> Consider app.config remapping of assembly "System.Web.Razor,PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.Razor.dll] to Version "2.0.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.AspNet.Razor.2.0.30506.0libnet40System.Web.Razor.dll] to solve conflict and get rid of warning. 1> Consider app.config remapping of assembly "WebGrease,PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [] to Version "1.3.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesWebGrease.1.3.0libWebGrease.dll] to solve conflict and get rid of warning. 1> Consider app.config remapping of assembly "System.Web.WebPages.Razor,PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.WebPages.Razor.dll] to Version "2.0.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.AspNet.WebPages.2.0.30506.0libnet40System.Web.WebPages.Razor.dll] to solve conflict and get rid of warning. 1> Consider app.config remapping of assembly "Microsoft.Data.OData,PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.5.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.Data.OData.5.5.0libnet40Microsoft.Data.OData.dll] to solve conflict and get rid of warning. 1> Consider app.config remapping of assembly "System.Web.WebPages,PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.WebPages.dll] to Version "2.0.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.AspNet.WebPages.2.0.30506.0libnet40System.Web.WebPages.dll] to solve conflict and get rid of warning. 1> Consider app.config remapping of assembly "DotNetOpenAuth.Core,PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesDotNetOpenAuth.Core.4.3.0.13117libnet45-fullDotNetOpenAuth.Core.dll] to solve conflict and get rid of warning. 1> Consider app.config remapping of assembly "System.Web.WebPages.Deployment,PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.WebPages.Deployment.dll] to Version "2.0.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.AspNet.WebPages.2.0.30506.0libnet40System.Web.WebPages.Deployment.dll] to solve conflict and get rid of warning. 1>C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. 1> Ruby -> C:UsersRobertDocumentsSBSoftwareSCMRubyRubybinRuby.dll 2>------ Build started: Project: Ruby.Azure,Configuration: Release Any CPU ------ 3>------ Publish started: Project: Ruby.Azure,Configuration: Release Any CPU ------ 3>C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.Bcl.Build.1.0.7toolsMicrosoft.Bcl.Build.targets(220,5): warning : All projects referencing Ruby.csproj must install nuget package Microsoft.Bcl.Build. 3> No way to resolve conflict between "System.Web.Mvc,PublicKeyToken=31bf3856ad364e35" arbitrarily. 3> Consider app.config remapping of assembly "DotNetOpenAuth.AspNet,PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesDotNetOpenAuth.AspNet.4.3.0.13117libnet45-fullDotNetOpenAuth.AspNet.dll] to solve conflict and get rid of warning. 3> Consider app.config remapping of assembly "System.Web.Mvc,PublicKeyToken=31bf3856ad364e35" from Version "3.0.0.0" [C:Program Files (x86)Microsoft ASP.NETASP.NET MVC 3AssembliesSystem.Web.Mvc.dll] to Version "4.0.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.AspNet.Mvc.4.0.30506.0libnet40System.Web.Mvc.dll] to solve conflict and get rid of warning. 3> Consider app.config remapping of assembly "System.Web.Razor,PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.Razor.dll] to Version "2.0.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.AspNet.Razor.2.0.30506.0libnet40System.Web.Razor.dll] to solve conflict and get rid of warning. 3> Consider app.config remapping of assembly "WebGrease,PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [] to Version "1.3.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesWebGrease.1.3.0libWebGrease.dll] to solve conflict and get rid of warning. 3> Consider app.config remapping of assembly "System.Web.WebPages.Razor,PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.WebPages.Razor.dll] to Version "2.0.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.AspNet.WebPages.2.0.30506.0libnet40System.Web.WebPages.Razor.dll] to solve conflict and get rid of warning. 3> Consider app.config remapping of assembly "Microsoft.Data.OData,PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.5.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.Data.OData.5.5.0libnet40Microsoft.Data.OData.dll] to solve conflict and get rid of warning. 3> Consider app.config remapping of assembly "System.Web.WebPages,PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.WebPages.dll] to Version "2.0.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.AspNet.WebPages.2.0.30506.0libnet40System.Web.WebPages.dll] to solve conflict and get rid of warning. 3> Consider app.config remapping of assembly "DotNetOpenAuth.Core,PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesDotNetOpenAuth.Core.4.3.0.13117libnet45-fullDotNetOpenAuth.Core.dll] to solve conflict and get rid of warning. 3> Consider app.config remapping of assembly "System.Web.WebPages.Deployment,PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.WebPages.Deployment.dll] to Version "2.0.0.0" [C:UsersRobertDocumentsSBSoftwareSCMRubypackagesMicrosoft.AspNet.WebPages.2.0.30506.0libnet40System.Web.WebPages.Deployment.dll] to solve conflict and get rid of warning. 3>C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. 3> Transformed Web.config using C:UsersRobertDocumentsSBSoftwareSCMRubyRubyWeb.Release.config into objReleaseTransformWebConfigtransformedWeb.config. 3>Ruby(0,0): warning WAT153: The web project 'Ruby' is dependent on the following MVC assembly: C:Program Files (x86)Microsoft ASP.NETASP.NET MVC 3AssembliesSystem.Web.Mvc.dll. MVC assemblies must be added to the package or installed on the virtual machine for your web role. For more details about this,see the following help page: http://go.microsoft.com/fwlink/?LinkId=218227. 3>Ruby(0,0): warning WAT153: The web project 'Ruby' is dependent on the following MVC assembly: C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.Razor.dll. MVC assemblies must be added to the package or installed on the virtual machine for your web role. For more details about this,0): warning WAT153: The web project 'Ruby' is dependent on the following MVC assembly: C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.WebPages.Razor.dll. MVC assemblies must be added to the package or installed on the virtual machine for your web role. For more details about this,0): warning WAT153: The web project 'Ruby' is dependent on the following MVC assembly: C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.WebPages.dll. MVC assemblies must be added to the package or installed on the virtual machine for your web role. For more details about this,0): warning WAT153: The web project 'Ruby' is dependent on the following MVC assembly: C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0AssembliesSystem.Web.WebPages.Deployment.dll. MVC assemblies must be added to the package or installed on the virtual machine for your web role. For more details about this,see the following help page: http://go.microsoft.com/fwlink/?LinkId=218227. 解决方法
您可以在web.config文件中使用
binding redirects来解决问题。
例如,对于行: Consider app.config remapping of assembly "DotNetOpenAuth.AspNet,PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" 添加到Web.config中: <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" culture="neutral" /> <bindingRedirect oldVersion="1.0.0.0-4.3.0.0" newVersion="4.3.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration> 等等…对于创建异常的每个dll,都会添加附加的dependencyAssembly节点。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 在asp.net mvc 3中实现FilterAttribute,IActionFilter和继承
- asp.net – 如何崩溃App Pool?
- 不重新编译DLL,让FCKEditor支持附件上传
- asp.net-mvc-4 – 如何通过Elastic Beanstalk手动将.NET MV
- 在asp.net上单击按钮的空文本框的Javascript验证
- asp.net – MiniProfiler.Stop()上的MVC Mini Profiler异常
- asp.net – 从数据库加载多个纬度/经度点到谷歌地图标记的好
- asp.net – 在EPiServer中的TinyMCE中允许自定义HTML属性
- asp.net-mvc-3 – ASP.NET MVC注入Http / Request / Contro
- asp.net – 加密cookie中的会话ID(或其他身份验证值)是否有
- asp.net-mvc – 什么是ASP.Net MVC查看引擎?
- asp.net – 即使它已经过时,仍然可以使用System.
- 通过经过身份验证的Webforms保护ASP.net中的Ajax
- ASP.net检查页面是http还是https
- asp.net-mvc – ASP.NET MVC依赖注入Unity与WCF服
- 从ASP.NET Core 3.0 preview 特性,了解CLR的Gar
- asp.net-mvc – 在ASP.NET MVC Web应用程序中托管
- asp.net-mvc – 使用HTML.EditorFor Vs使用HTML.
- asp.net – 错误HTTP 404.11通过查询字符串传递帐
- asp.net-mvc – 如何使用wmd-editor控件检索mark