简体   繁体   English

如何部署ASP.NET MVC 4应用程序?

[英]How to deploy ASP.NET MVC 4 app?

This is my first experience developing the MVC app and I started with MVC 4, I have used my own template and maintained different directory structure as : 这是我开发MVC应用程序的第一次经验,我从MVC 4开始,我使用了自己的模板,并维护了以下不同的目录结构:

在此处输入图片说明

And referenced resources like : 以及引用的资源,例如:

<img src="@Url.Content("~/Content/images/regionBase.gif")" style="width:80%;" onclick="" usemap="#regionMap" id="regionBase">

       bundles.Add(new StyleBundle("~/Content/css").Include(
                "~/Content/site.css",
                "~/Content/jquery.bonsai.css",
                "~/Content/tooltipster.css"));

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-1.8.2.js",
                        "~/Scripts/jquery.tooltipster.js",
                        "~/Scripts/jquery.bonsai.js",
                        "~/Scripts/imageMapResizer.js"
                        ));

Everything works well till its runs in visual studio, the moment I Publish(using Publish Method: File System) to the localhost build doesn't includes: images from Content folder, JS from the "Scripts" folder. 一切正常,直到在Visual Studio中运行为止,我发布(使用发布方法:文件系统)到本地主机版本的那一刻不包括:Content文件夹中的图像,JS文件夹中“ Scripts”的图像。

Not able to figure If I am missing any step, there is any other way to Deploy the MVC 4 project, beside the options mentioned under the Publish Tools. 无法确定如果我缺少任何步骤,除了“发布工具”下提到的选项之外,还有其他方法可以部署MVC 4项目。

Please enlighten me. 请赐教。

Right-click on each file that you want to deploy in solution explorer, then choose 'Include In Project'. 右键单击要在解决方案资源管理器中部署的每个文件,然后选择“包含在项目中”。 then if you publish the project, the included file comes to publish folder. 然后,如果您发布项目,则包含的文件将进入publish文件夹。 You can prevent files to publish with same method and choose 'Exclude From Project'. 您可以使用相同的方法阻止文件发布,然后选择“从项目中排除”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM