如何通过ftp将MVC3网站部署到服务器

时间:2013-02-04 07:54:51

标签: asp.net-mvc deployment iis-7 asp.net-mvc-4 filezilla

我能够将网站发布到本地机器文件夹,其中我有bin,content,scripts,views,web,global和packages文件夹。 我使用filezilla将这些文件夹添加到我的Web服务器的根目录后,该网站无法正常工作。服务器确实支持asp.net 4,ii7。 究竟是什么步骤。我寻找一些谷歌搜索的答案,但没有一个帮助。如果你能帮助我解决这个问题,我真的很感激,谢谢

更新问题已修复:我的项目使用的是.net 4.5而不是4.0 ...导致我在部署网站的服务器上出现问题

2 个答案:

答案 0 :(得分:2)

部署应用程序有两个步骤:

1. If ASP.NET MVC 3.0 is not installed on the server you should deploy the following set of assemblies in the bin folder of your web 
application:

Microsoft.Web.Infrastructure.dll
System.Web.Helpers.dll
System.Web.Mvc.dll
System.Web.Razor.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll
 you can set copy local to true but this is not available for all listed dll's or you can use some interesting future: right click on the project and select Add Deployable Dependencies with ASP.NET checkbox checked.A special folder named _bin_deployableAssemblies will be created with all necessary assemblies copied into this folder. When the project will be compiled all this assemblies will be copied into bin folder.

2. Publish the application: in a local folder and copy it to your deployment server or directly via FTP.

答案 1 :(得分:0)

在属性窗口中将引用标记为Copy to Bin Directory将确保将DLL复制到/ bin目录。