Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何部署ASP.NET MVC 4应用程序?_C#_Asp.net Mvc_Asp.net Mvc 4_Visual Studio 2013 - Fatal编程技术网

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

C# 如何部署ASP.NET MVC 4应用程序?,c#,asp.net-mvc,asp.net-mvc-4,visual-studio-2013,C#,Asp.net Mvc,Asp.net Mvc 4,Visual Studio 2013,这是我第一次开发MVC应用程序,我从MVC 4开始,我使用了自己的模板并维护了不同的目录结构,如下所示: 和参考资源,如: <img src="@Url.Content("~/Content/images/regionBase.gif")" style="width:80%;" onclick="" usemap="#regionMap" id="regionBase"> bundles.Add(new StyleBundle("~/Content/css").In

这是我第一次开发MVC应用程序,我从MVC 4开始,我使用了自己的模板并维护了不同的目录结构,如下所示:

和参考资源,如:

<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"
                        ));

添加(新样式包(“~/Content/css”)。包括(
“~/Content/site.css”,
“~/Content/jquery.bonsai.css”,
“~/Content/tooltipster.css”);
添加(新脚本包(“~/bundles/jquery”)。包括(
“~/Scripts/jquery-1.8.2.js”,
“~/Scripts/jquery.tooltipster.js”,
“~/Scripts/jquery.bonsai.js”,
“~/Scripts/imageMapResizer.js”
));
在visualstudio中运行之前,一切都运行良好,而我发布(使用发布方法:文件系统)到localhost构建的那一刻并不包括:Content文件夹中的图像,以及“Scripts”文件夹中的JS

不知道我是否遗漏了任何步骤,除了发布工具中提到的选项之外,还有其他方法来部署MVC4项目


请告诉我。

右键单击要在解决方案资源管理器中部署的每个文件,然后选择“包含在项目中”。然后,如果发布项目,包含的文件将进入“发布”文件夹。
您可以使用相同的方法阻止文件发布,并选择“从项目中排除”。

ah愚蠢的错误,花了我半天的时间,谢谢您的帮助。默认情况下,当您添加资源时,它们是否被排除在解决方案之外?我很高兴。如果复制文件,然后粘贴到解决方案资源管理器中,则会自动包含文件。