4

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.

Owen Blacker
  • 4,117
  • 2
  • 33
  • 70
Erdem
  • 95
  • 1
  • 5

4 Answers4

3

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!

Chris Stavropoulos
  • 1,766
  • 13
  • 27
  • deleting System.Web.WebPages.dll is a bad idea.We need that for the MVC on the server..isnt it? as suggested by Phil in his blog – bhargav Apr 27 '12 at 14:09
  • in my case MVC bin-deployed so removing it from the local bin of the application doesn't affect anything else on the server anyway. YMMV – Chris Stavropoulos Apr 27 '12 at 14:57
  • Do you mean that you deleted System.Web.WebPages.Administration.dll ? – Chris Haines Nov 16 '12 at 12:24
  • @Hainesy possibly? I don't remember at this point. I imagine wherever that namespace is located is the file I deleted. That being said, I'm pretty sure the newest nuget server packages are more solid than this old one was so if you're still having this problem with the newer codebase, I'd consider either posting a new question (reference this one?) and possibly even opening a bug with the team. – Chris Stavropoulos Nov 21 '12 at 16:27
  • Yes, I had to delete System.Web.WebPages.Administration.dll to get it working – Matt Kemp Oct 08 '18 at 08:19
2

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>
Haacked
  • 58,045
  • 14
  • 90
  • 114
  • 3
    With correct binding redirect configuration, another problem occured: Method 'AddFrameworkReference' in type 'System.Web.WebPages.Administration.PackageManager.WebProjectSystem' from assembly 'System.Web.WebPages.Administration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation. – Erdem May 25 '11 at 06:27
  • Same issue but with 1.4: – Ian Mercer Aug 03 '11 at 20:04
0

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.

Adam Lear
  • 38,111
  • 12
  • 81
  • 101
Tom Stickel
  • 19,633
  • 6
  • 111
  • 113
  • 2
    Well to be fair, it's 2011 and you're still using IIS 6 from 2003 which was out 8 years ago! ;) it's gotten easier since then with Integrated mode. – Haacked Aug 08 '11 at 02:17
  • 1
    I got 99 problems but a .... Well, with working on a contract for the state government, I don't have a choice. Windows 2008 Server will be implemented within 12 months. – Tom Stickel Aug 09 '11 at 06:25
0

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.

cfbarbero
  • 1,607
  • 2
  • 14
  • 26