Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 与Microsoft HTTP客户端库v2.1.10 NuGet更新相关的问题_Asp.net Mvc_Visual Studio_Visual Studio 2012_Nuget - Fatal编程技术网

Asp.net mvc 与Microsoft HTTP客户端库v2.1.10 NuGet更新相关的问题

Asp.net mvc 与Microsoft HTTP客户端库v2.1.10 NuGet更新相关的问题,asp.net-mvc,visual-studio,visual-studio-2012,nuget,Asp.net Mvc,Visual Studio,Visual Studio 2012,Nuget,注意:这个问题在最初发布几天后被完全重写了 我在VS 2012中开发了一个ASP.NET MVC应用程序,部署到Azure。原始项目是从ASP.NET MVC 4项目模板创建的 NuGet最近开始展示微软的一系列更新包。其中一个更新,Microsoft HTTP客户端库v2.1.10,在安装时会导致严重问题 它安装了MicrosoftBcl.Build,它与我的Azure项目不兼容(有关问题及其解决方案,请参阅) 它会导致一系列“不兼容的DLL”问题(见下文) 这引发了几个紧迫的问题: 我的MV

注意:这个问题在最初发布几天后被完全重写了

我在VS 2012中开发了一个ASP.NET MVC应用程序,部署到Azure。原始项目是从ASP.NET MVC 4项目模板创建的

NuGet最近开始展示微软的一系列更新包。其中一个更新,Microsoft HTTP客户端库v2.1.10,在安装时会导致严重问题

  • 它安装了MicrosoftBcl.Build,它与我的Azure项目不兼容(有关问题及其解决方案,请参阅)

  • 它会导致一系列“不兼容的DLL”问题(见下文)

  • 这引发了几个紧迫的问题:

  • 我的MVC应用程序只是一个网站。它只是在网络浏览器中运行。我需要这个包裹吗?(例如,它是否由模板代码使用,如果我删除包,模板代码可能会微妙地中断?)

  • 根据项目站点(),该产品有两个较新的版本(尽管是beta版)。如果我告诉NuGet给我看未发布的版本,我想我会看到它们的。这些版本是否解决了上述问题

  • 以下是我在安装更新的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, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" arbitrarily.
    1>  Consider app.config remapping of assembly "DotNetOpenAuth.AspNet, Culture=neutral, PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\DotNetOpenAuth.AspNet.4.3.0.13117\lib\net45-full\DotNetOpenAuth.AspNet.dll] to solve conflict and get rid of warning.
    1>  Consider app.config remapping of assembly "System.Web.Mvc, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "3.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll] to Version "4.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll] to solve conflict and get rid of warning.
    1>  Consider app.config remapping of assembly "System.Web.Razor, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.Razor.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll] to solve conflict and get rid of warning.
    1>  Consider app.config remapping of assembly "WebGrease, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [] to Version "1.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\WebGrease.1.3.0\lib\WebGrease.dll] to solve conflict and get rid of warning.
    1>  Consider app.config remapping of assembly "System.Web.WebPages.Razor, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Razor.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll] to solve conflict and get rid of warning.
    1>  Consider app.config remapping of assembly "Microsoft.Data.OData, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.5.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.Data.OData.5.5.0\lib\net40\Microsoft.Data.OData.dll] to solve conflict and get rid of warning.
    1>  Consider app.config remapping of assembly "System.Web.WebPages, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll] to solve conflict and get rid of warning.
    1>  Consider app.config remapping of assembly "DotNetOpenAuth.Core, Culture=neutral, PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\DotNetOpenAuth.Core.4.3.0.13117\lib\net45-full\DotNetOpenAuth.Core.dll] to solve conflict and get rid of warning.
    1>  Consider app.config remapping of assembly "System.Web.WebPages.Deployment, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Deployment.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll] to solve conflict and get rid of warning.
    1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
    1>  Ruby -> C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\Ruby\bin\Ruby.dll
    2>------ Build started: Project: Ruby.Azure, Configuration: Release Any CPU ------
    3>------ Publish started: Project: Ruby.Azure, Configuration: Release Any CPU ------
    3>C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.Bcl.Build.1.0.7\tools\Microsoft.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, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" arbitrarily.
    3>      Consider app.config remapping of assembly "DotNetOpenAuth.AspNet, Culture=neutral, PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\DotNetOpenAuth.AspNet.4.3.0.13117\lib\net45-full\DotNetOpenAuth.AspNet.dll] to solve conflict and get rid of warning.
    3>      Consider app.config remapping of assembly "System.Web.Mvc, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "3.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll] to Version "4.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll] to solve conflict and get rid of warning.
    3>      Consider app.config remapping of assembly "System.Web.Razor, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.Razor.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll] to solve conflict and get rid of warning.
    3>      Consider app.config remapping of assembly "WebGrease, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [] to Version "1.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\WebGrease.1.3.0\lib\WebGrease.dll] to solve conflict and get rid of warning.
    3>      Consider app.config remapping of assembly "System.Web.WebPages.Razor, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Razor.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll] to solve conflict and get rid of warning.
    3>      Consider app.config remapping of assembly "Microsoft.Data.OData, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.5.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.Data.OData.5.5.0\lib\net40\Microsoft.Data.OData.dll] to solve conflict and get rid of warning.
    3>      Consider app.config remapping of assembly "System.Web.WebPages, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll] to solve conflict and get rid of warning.
    3>      Consider app.config remapping of assembly "DotNetOpenAuth.Core, Culture=neutral, PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\DotNetOpenAuth.Core.4.3.0.13117\lib\net45-full\DotNetOpenAuth.Core.dll] to solve conflict and get rid of warning.
    3>      Consider app.config remapping of assembly "System.Web.WebPages.Deployment, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Deployment.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll] to solve conflict and get rid of warning.
    3>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
    3>      Transformed Web.config using C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\Ruby\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
    3>Ruby(0,0): warning WAT153: The web project 'Ruby' is dependent on the following MVC assembly: C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.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.NET\ASP.NET Web Pages\v1.0\Assemblies\System.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, 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.NET\ASP.NET Web Pages\v1.0\Assemblies\System.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, 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.NET\ASP.NET Web Pages\v1.0\Assemblies\System.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, 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.NET\ASP.NET Web Pages\v1.0\Assemblies\System.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文件中使用来解决问题

    例如,对于第行:

    Consider app.config remapping of assembly "DotNetOpenAuth.AspNet, Culture=neutral, 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,添加额外的
    dependentAssembly
    节点。

    导致此错误的一种情况是运行Azure软件包或发布命令,但之前没有对相同配置(例如发布)执行干净的重新生成

    这为我解决了这个问题:

  • 通过在NuGet软件包管理器控制台上运行以下命令,重新安装WindowsAzure.Storage NuGet软件包:

    Update-Package –reinstall WindowsAzure.Storage
    
  • 重建MVC web应用程序项目(调试和发布)


  • 如果这没有帮助,您可以将“工具”->“选项”->“项目和解决方案”->“生成并运行”下的“MSBuild项目生成输出详细信息”设置为“诊断”,并检查导致程序集冲突的原因(例如,查找“导致引用的项目文件项包括”).

    您需要使用此处提到的重定向更新/创建app.config文件:


    您读过吗?在开发环境中(与Azure没有任何关系),添加需要
    Microsoft.Bcl.Build
    的Nuget软件包会产生相同的警告。我在MVC 4应用程序中也有相同的问题——只是我没有发布到Azure…只是一个普通的旧Windows 2008 R2 Web服务器。我的问题与此处的原始海报相同(我没有将我的应用发布到Azure除外)并立即添加绑定重定向。这并不能解决问题。它应该…但它没有。我有同样的问题,也尝试绑定重定向没有运气。如上图所示,您需要显式地使用
    dependentAssembly
    ,而不仅仅是
    bindingRedirect
    。这个答案为我提供了NuGet包还原的窍门。切换到发布配置(在我的情况下为Release),清理解决方案,重建解决方案-在包还原的情况下,可能需要执行两次。然后发布到Azure works。谢谢创建一个
    app.config
    文件&从我的
    web.config
    复制重定向为我摆脱了愚蠢的警告。但是我仍然不明白为什么我需要一个MVC项目的
    app.config
    文件。哦,我很高兴终于摆脱了那些讨厌的警告!