简体   繁体   English

复制到输出目录=复制对于VS2013始终不起作用

[英]Copy to Output Directory = Copy Always not working for VS2013

I have asp.net mvc 5 application and websetup project in a VS2013 solution. 我在VS2013解决方案中有asp.net mvc 5应用程序和websetup项目。 I have added the asp.net mvc5 application as the Project output for the web setup project. 我已将asp.net mvc5应用程序添加为Web安装项目的“项目”输出。 Now I have web.config files for Areas, Views section. 现在,我具有“区域”,“视图”部分的web.config文件。 I have set them with Build Action = Content and Copy to Output Directory = Copy Always. 我将它们设置为“构建操作=内容并复制到输出目录=始终复制”。 On building the web setup project and deploying it to web server ,I see that there are no web.config files for Areas, Views section in the output. 在构建Web安装项目并将其部署到Web服务器时,我看到输出中没有Areas,Views部分的web.config文件。 Can anyone help me to know how to resolve this issue ? 谁能帮助我知道如何解决此问题?

The typical setup for an ASP.NET web project does not require copying the web.config to the build folder. ASP.NET Web项目的典型设置不需要将web.config复制到生成文件夹。

You could selected Build Action "Content" and Copy to Output Directory "Do not copy" 您可以选择构建操作“内容”,然后复制到输出目录“不复制”

If you Publish your project, the content files will be published. 如果发布项目,则将发布内容文件。 They will not be placed in the bin folder, but rather alongside the app where IIS expects them. 它们不会放置在bin文件夹中,而是放在IIS期望它们的应用程序旁边。 The publish step may produce output similar to the following. 发布步骤可能会产生类似于以下内容的输出。

Publishing folder bin... Publishing folder Content... Publishing folder Scripts... Publishing folder Views... Publishing folder Views/Home... Publishing folder Views/Shared… 发布文件夹bin ...发布文件夹Content ...发布文件夹Scripts ...发布文件夹Views ...发布文件夹Views / Home ...发布文件夹Views / Shared ...

If you must use WebSetup (instead of Publish) to deploy the web app, you will want to add the necessary files to the WebSetup FileSystem tab (including content and output). 如果必须使用WebSetup(而不是Publish)来部署Web应用程序,则需要将必要的文件添加到WebSetup FileSystem选项卡(包括内容和输出)。

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

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