如何防止外部文档文件被复制到ASP.NET应用程序中的bin文件夹

时间:2021-04-10 23:22:06

I'm (still) using Visual Studio 2008. I have an ASP.NET web application with some files in a folder at the root level of my project called "resources". That folder includes jQuery includes, etc., as well as a PDF file that is documentation for the users of the application. The directory structure looks like this:

我(仍然)使用Visual Studio 2008.我有一个ASP.NET Web应用程序,其中包含一些名为“resources”的项目根级别文件夹中的文件。该文件夹包括jQuery包含等,以及PDF文件,该文件是应用程序用户的文档。目录结构如下所示:

Project
  |__ Properties
  |__ References
  |__ (etc.)
  |__ bin
  |__ (etc.)
  |__ resources
        |__ (etc.)
        |__ docs
              |__ DocumentationFile.pdf

The issue I'm having is that resources/docs/ (empty folder) is being created in /bin when I publish the application. The folder and its contents are being copied to the proper location at the root level as well, so everything works.

我遇到的问题是,当我发布应用程序时,在/ bin中创建了resources / docs /(空文件夹)。该文件夹及其内容也被复制到根级别的适当位置,因此一切正常。

But my OCD tendencies force me to try and figure out why I'm getting the extra copy in /bin. Can anyone explain this phenomenon?

但是我的OCD倾向迫使我试图找出为什么我在/ bin中获得额外的副本。有谁能解释这种现象?

I have the file DocumentationFile.pdf marked as "Content" under "Properties" in the Solution Explorer, before I did that it wasn't being copied over at all. And I used to have the "Copy to Output Directory" property set to "Copy if newer", but found that didn't seem to be necessary, so I changed it back to "Do not copy" (though I don't know what would happen if I update the document, would the new version get published?)

我在解决方案资源管理器中的“属性”下将文件DocumentationFile.pdf标记为“内容”,之前我没有将其复制过来。我曾经将“复制到输出目录”属性设置为“复制如果更新”,但发现似乎没有必要,所以我把它改回“不要复制”(虽然我不知道如果我更新文档会发生什么,新版本会发布吗?)

Thanks for any insight you can provide.

感谢您提供的任何见解。

1 个解决方案

#1


0  

I just figured it out - the bin/resources/docs folder was a leftover empty folder that was cluttering up my project directory, left over from when I had the "Copy to Output Directory" property on my documentation file set to "Copy if newer".

我只想出来了 - bin / resources / docs文件夹是一个剩余的空文件夹,它混乱了我的项目目录,当我将文档文件中的“Copy to Output Directory”属性设置为“Copy if newer”时遗留下来”。

#1


0  

I just figured it out - the bin/resources/docs folder was a leftover empty folder that was cluttering up my project directory, left over from when I had the "Copy to Output Directory" property on my documentation file set to "Copy if newer".

我只想出来了 - bin / resources / docs文件夹是一个剩余的空文件夹,它混乱了我的项目目录,当我将文档文件中的“Copy to Output Directory”属性设置为“Copy if newer”时遗留下来”。