After reading quite few articles on deployment, i am bit confused about the procedure.
All the articles refer to dlls which aren’t reference in Asp.net mvc project. The dlls are like following :-
- Microsoft.Web.Infrastructure.dll
- System.Web.Razor.dll
- System.Web.WebPages.Deployment.dll
- System.Web.WebPages.Razor.dll
I created the MVC Music Store application from a tutorial on asp.net website and it works fine in visual studio. In the project, there is no reference to the above given assemblies(not even the razor but i am using razor engine only).
So why should i add the above files to the bin directory if my project is running without referencing them in the first place
Those assemblies need to be available somehow. If you have installed ASP.NET MVC 3 then they will be registered in the GAC (see here: http://weblogs.asp.net/scottgu/archive/2011/01/18/running-an-asp-net-mvc-3-app-on-a-web-server-that-doesn-t-have-asp-net-mvc-3-installed.aspx).
If not (e.g. if you are using shared hosting which doesn’t have ASP.NET MVC 3 installed), then you will need to bin deploy them as described here: http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx
Refer to the second link to actually do the deployment. The first link is more for background reading.