Nuget.Core.dll 版本号不匹配

发布于 2024-11-03 18:26:47 字数 640 浏览 3 评论 0原文

我不知道应该如何部署由 nuget.server 包创建的网站。 服务器上未安装 ASP.Net MVC,因此我向项目“添加可部署依赖项”并选择“使用 Razor 语法的 ASP.NET 网页”。

问题是它添加了版本 1.0.11220.104 的 Nuget.Core.dll,但 nuget.server 包添加了版本 1.3.20419.9005 的 Nuget.Core.dll 的引用。

部署更高版本后,我得到了

无法加载文件或程序集“NuGet.Core,版本=1.0.11220.104”消息。 部署较低版本后,我收到“编译器错误消息:CS1705:程序集 'NuGet.Server,Version=1.3.20426.373,Culture=neutral,PublicKeyToken=null' 使用 'NuGet.Core,Version=1.3.20419.9005,Culture=neutral, PublicKeyToken=31bf3856ad364e35' 的版本高于引用的程序集 'NuGet.Core, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35'"。

我该如何解决这个问题?

谢谢。

I could not figure out how should I deploy a web site created by nuget.server package.
ASP.Net MVC is not installed on server, so I "add deployable dependencies" to my project and select "ASP.NET Web Pages with Razor syntax".

The problem with that is it adds Nuget.Core.dll with version 1.0.11220.104, but nuget.server package adds a reference for Nuget.Core.dll with version 1.3.20419.9005.

With higher version deployed, I got

Could not load file or assembly 'NuGet.Core, Version=1.0.11220.104" message.
With lower version deployed, I got "Compiler Error Message: CS1705: Assembly 'NuGet.Server, Version=1.3.20426.373, Culture=neutral, PublicKeyToken=null' uses 'NuGet.Core, Version=1.3.20419.9005, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'NuGet.Core, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35'".

How can I solve this?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

花之痕靓丽 2024-11-10 18:26:47

在 Visual Studio 中使用“添加可部署垃圾箱”选项后,我遇到了同样的问题。我按照Haacked的建议设置了程序集绑定重定向,但修改了绑定重定向以使其实际工作。 ;)

<bindingRedirect oldVersion="0.0.0.0-1.3.20419.9005"
                             newVersion="1.3.20419.9005"/>

之后我收到错误,您使用 System.Web.Webpages.Administrator 获取 Erdem。我进入 bin 文件夹并删除了 System.Web.WebPages.dll,所有内容都亮了起来,现在工作得很好!

I ran into the same issue after using the 'add deployable bin' option in visual studio. I set the assemblybinding redirect as suggested by Haacked but modified the bindingRedirect to actually work. ;)

<bindingRedirect oldVersion="0.0.0.0-1.3.20419.9005"
                             newVersion="1.3.20419.9005"/>

After that I was getting the error you were getting Erdem with System.Web.Webpages.Administrator. I went into the bin folder and deleted the System.Web.WebPages.dll and everything lit up and now works great!

落在眉间の轻吻 2024-11-10 18:26:47

尝试在 web.config 中添加指向更高版本的绑定重定向。另外,如果您不介意,请帮助我们并在 http://nuget 上记录详细的错误.codeplex.com/workitem/list/basic

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="NuGet.Core"
                              publicKeyToken="31bf3856ad364e35"
                              culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0"
                             newVersion="1.3.20419.9005"/>
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>

Try adding a binding redirect in your web.config pointing to the higher version. Also, if you don't mind, help us out and log a detailed bug at http://nuget.codeplex.com/workitem/list/basic

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="NuGet.Core"
                              publicKeyToken="31bf3856ad364e35"
                              culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0"
                             newVersion="1.3.20419.9005"/>
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>
〆凄凉。 2024-11-10 18:26:47

似乎唯一未包含的引用是 Microsoft.Web.Infrastruct。为了解决此问题,我添加了“具有 Razor 语法的 ASP.NET 网页”的可部署依赖项,然后删除了“_bin_deployableAssemblies”文件夹中除 Microsoft.Web.Infrastruct 之外的所有项目。这解决了这个问题。

It appears the only unincluded reference is Microsoft.Web.Infrastructure. To resolve this, I added Deployable Dependencies for 'ASP.NET Web Pages with Razor Syntax' and then deleted all items in the '_bin_deployableAssemblies' folder except for Microsoft.Web.Infrastructure. This fixed the issue.

献世佛 2024-11-10 18:26:47

真是一场噩梦。快到 2011 年 7 月了,我花了几个小时摆弄部署,就像这是一个 Java 项目一样:( 呃

对于使用 MVC3 / vs 2010 使用框架 4.0 的 IIS6(Windows 2003 服务器)部署:

  1. 在虚拟目录中进行通配符映射指向 4.0 .. C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
  2. 我会创建一个新的应用程序池来指向它,
  3. 也缺少无数不那么有趣的程序集 。如果您有权访问服务器来安装 mvc 3 更新(也包括 mvc 3),请从 下载http://www.asp.net/mvc 并将其安装在服务器上。

首先,我将所有这些文件复制到

  • Microsoft.Web.Infrastruct
  • System.Web.Razor
  • System.Web.WebPages
  • System.Web.WebPages 上。 .Razor,

但是,如果您在服务器上安装 MVC 3,那么您可能不需要这样做。我已经尝试了一切。在服务器上安装 MVC 修复了它!对于 Godaddy 和其他 .NET 托管提供商,他们应该已经安装了 MVC 和程序集。

What a nightmare. It is almost July 2011, and I am fiddling with deploying for hours like as if this is a Java project :( ughhh

For IIS6 (windows 2003 server) deployment with MVC3 / vs 2010 using framework 4.0:

  1. Do the wildcard mapping within a virtual directory pointing at 4.0 .. C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
  2. I would create a new application pool to point it too.
  3. Countless not so fun assemblies missing, so if you have access to the server to install the mvc 3 update update (which include mvc 3 as well) do that, download from http://www.asp.net/mvc and install it on the server.

At first I copied all these files over

  • Microsoft.Web.Infrastructure
  • System.Web.Razor
  • System.Web.WebPages
  • System.Web.WebPages.Razor ,

But, if you install MVC 3 on the server, then you may not need to. The deal breaker for me that I was stressing about was this error "'System.Web.WebPages.Administration ..." that @Erdem mentioned. I tried EVERYTHING. Installing MVC on the server fixed it! For Godaddy and other .NET hosting providers, they should already have MVC and assemblies installed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文