文件夹未使用 VS Publish / Web Deploy 上传

发布于 2024-11-02 09:04:13 字数 208 浏览 1 评论 0原文

我正在使用 VS 2010 中的“发布/Web 部署”选项来发布我的 ASP.NET MVC3 网站。

但是,默认情况下它不会发布我在下面突出显示的“文件”文件夹。

在此处输入图像描述

有什么想法可以在发布过程中包含此文件吗?

谢谢保罗

I am using the Publish / Web Deploy option within VS 2010 to publish my ASP.NET MVC3 website.

However it does not by default publish my "files" folder that I have highlighted below.

enter image description here

Any ideas how I can get this file included during publishing?

Thanks Paul

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

陈年往事 2024-11-09 09:04:13

在 Visual Studio 解决方案资源管理器中,您需要右键单击该目录中每个文件并选择属性(您可以一次选择所有文件,然后右键单击 -> 属性,如果您想更改所有文件)。

确保构建操作设置为内容。这将确保在发布过程中复制文件。

Within the Visual Studio Solution Explorer you need to right-click and select properties on each of the files within that directory (you can select them all at once and then right-click -> properties if you want to change them all).

Make sure the Build Action is set to Content. This will ensure that the files are copied as part of the publish process.

潇烟暮雨 2024-11-09 09:04:13

就我而言,Error.txt 文件未包含在项目中,并且在发布项目期间未添加文件夹。

右键单击文件名,然后单击“包含在项目中”
在此处输入图像描述

In my case, the Error.txt file was not included in the Project and the Folder was not added during the Publish project.

I right-click the file name and click on"Include in Project"
enter image description here

不再见 2024-11-09 09:04:13

一种可能不太常见的情况是,某人(可能是您自己)在 csproj 文件中添加了 Content\files 行,然后忘记了它,后来您确实想要发布文件夹。

由于这一行,即使 BuildAction 是 Content,Content/files(和子文件夹)中的任何文件都不会被部署。

这很难发现,因为据我所知,它在 Visual Studio 中的任何地方都不可见,您必须使用文本编辑器打开 csproj 文件。

A probably less common case is when someone (maybe yourself) added a <ExcludeFoldersFromDeployment>Content\files</ExcludeFoldersFromDeployment> line in the csproj file, and then forgot about it, and later you do want to publish the folder.

Because of this line, none of the files in Content/files (and subfolders) will be deployed, even if the BuildAction is Content.

This is hard to spot because, AFAIK, it is not visible anywhere in visual studio, you have to open the csproj file with a text editor.

七分※倦醒 2024-11-09 09:04:13

就我而言,我看不到将文件的构建操作设置为内容的选项,因此我必须:

  1. 右键单击文件夹> > “从项目中排除”
  2. 右键单击文件夹> “包含在项目中”

此外,请确保当您右键单击文件>时属性中,“复制到输出目录”设置为“始终复制”或“较新时复制”。

In my case I couldn't see the option to set files' Build Action to Content so I had to:

  1. Right click on the folder > "Exclude From Project"
  2. Right click on the folder > "Include In Project"

Also, make sure that when you right click on file > Properties, the "Copy to Output Directory" is set to either "Always Copy" or "Copy When Newer".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文