0

I've mvc3.0 (.net 4.0) application that needs to be deployed to windows server 2008.

Could some one please help with my queries below?

  1. Do I need to install MVC 3.0 on server if I've referenced all MVC dll (with Copy Local set to true?)

  2. If I had MVC 2.0 installed on web server, does IIS picks MVC2.0 dll or MVC 3 given step 1 scenario above?

  3. When does IIS looks at DLL vs. BIN folder?

Thanks heaps.

Raphaël Althaus
  • 59,727
  • 6
  • 96
  • 122
Nil Pun
  • 17,035
  • 39
  • 172
  • 294

3 Answers3

3

1.) Do I need to install MVC 3.0 on server if I've referenced all MVC dll (with Copy Local set to true?)

No, you could bin deploy your application.

2.) If I had MVC 2.0 installed on web server, does IIS picks MVC2.0 dll or MVC 3 given step 1 scenario above?

Assuming you have placed proper assembly binding redirects in your web.config It will pick MVC 3:

<runtime>
   <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
     <dependentAssembly>
       <assemblyIdentity name="System.Web.Mvc"
           publicKeyToken="31bf3856ad364e35"/>
       <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0"/>
     </dependentAssembly>
   </assemblyBinding>
</runtime>

3.) When does IIS looks at DLL vs. BIN folder?

When the application starts, or when first required (assuming some assemblies could be dynamically loaded at runtime).

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
1

Do I need to install MVC 3.0 on server if I've referenced all MVC dll (with Copy Local set to true?)

Not Necessary. You can run an MVC application without installing MVC in your server. There is something called deployable dependency in Visual studio. That will publish your MVC DLLs in your bin folder when you publish it

from the msdn page,

This will add assemblies (DLL files) to a Web site project or Web application project. When you deploy your Web site or application, the files are included in the deployed project. This is useful if applications or technologies that your project depends on are not already installed on the server that will host your Web project. For example, you can use this feature to deploy an ASP.NET MVC 3 Web application to a server that does not have ASP.NET MVC 3 installed.

Checkout this answer where i have given step by step instruction how to do this.

Check this post for more details http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx

You should have Visual Studio 2010 SP1. Otherwise it will not be shown in the context menu when you right click on the project to be published.

Community
  • 1
  • 1
Shyju
  • 214,206
  • 104
  • 411
  • 497
0
  1. Already asked, see - ASP.NET MVC deployment in a form of distribution package

  2. it'll get exact version, which you used to build application

  3. Local assembly has priority over GAC (global assembly cache)

Community
  • 1
  • 1
Michael T
  • 988
  • 9
  • 9