.NET MVC3 - 发布网站时 /Content 文件夹中的文件夹丢失

发布于 2024-12-01 04:40:42 字数 134 浏览 1 评论 0原文

我的 /Content 文件夹中有一个文件夹,当我构建和发布我的网站时,该文件夹未包含在内。仅包含标准 CSS、图像、脚本和主题文件夹。我还有一个“下载”文件夹,其中包含尚未包含的 .doc 文件。

我是否仅限于/内容以下级别设置的标准?

I have a folder in my /Content folder which is not being included when I build and publish my website. Only the standard CSS, Images, Scripts and themes folders have been included. I also have a Downloads folder containing .doc files that has not been included.

Am I limited to the standard set at the level below /Content?

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

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

发布评论

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

评论(2

万人眼中万个我 2024-12-08 04:40:42

通常不会部署空文件夹。

对于“下载”文件夹,其包含的项目的“构建操作”设置为多少?对于您想要部署的任何内容,它们应该设置为“内容”。对于某些文件类型(例如 PDF 等),不会自动设置此设置。

部署的唯一项目必须在项目中引用(也就是说,它们必须出现在解决方案资源管理器中,而不仅仅是出现在文件夹中)在磁盘上)
,并设置正确的构建操作。

在此处输入图像描述

您还可以将“复制到输出目录”设置设置为 True 并查看会发生什么情况。

Empty folders typically don't get deployed.

For the Downloads folder, what's the "Build Action" set to for the items that it contains? They should be set to "Content" for anything that you want deployed. This isn't automatically set for some file types, such as PDF, etc.

The only items that get deployed have to be both referenced in the project (that is, they have to appear in the solution explorer, not just present in the folder on disk)
, and have the correct build action set.

enter image description here

You might also set the "Copy To Output Directory" setting to True and see what happens.

权谋诡计 2024-12-08 04:40:42

在 Visual Studio 中,右键单击 /Content 文件夹下的每个文件夹,然后选择包含在项目中。否则,这些文件仅物理地存在于磁盘上,但项目不知道它们在那里并且不会发布它们。

In Visual Studio, right click on every folder underneath /Content folder, and choose Include In Project. Else, the files are only physically there on disk but the project doesn't know they are there and doesn't publish them.

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