从 ASP.NET 网站的源代码管理中排除文件夹?
现在我正在使用一个 ASP.NET 网站,该网站会自动生成图像并将其存储在临时文件夹中。 在我的本地系统上工作时,这些文件会进入一个临时文件夹,由 Visual Source Safe 拾取,然后将其签入。因此,我想知道是否有一种方法可以从源代码管理中排除该特定文件夹?
我做了一些阅读,发现有一些方法可以为 单个文件,但我还没有找到有关整个文件夹的任何内容。
Right now I'm working with an ASP.NET website that automatically generates images and stores them in a temporary folder. When working on my local system these go going into a temporary folder that gets picked up by Visual Source Safe which then wants to check them in. As such, I am wondering if there is a way to just exclude that particular folder from source control?
I've done a bit of reading and found that there are ways to do this for individual files, but I haven't found anything yet about an entire folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您可以让您的应用程序写入网站外部的临时文件夹吗?
例如,在
C:\tempfiles
中,VSS 应该无法拾取它。
Could you just make your application write to a temporary folder that is outside of your website?
e.g. in
C:\tempfiles
VSS shouldn't be able to pick it up then.
我建议从您的网站清空/删除您的文件夹。 让您的网站在启动时创建/验证该文件夹,并在关闭时清理它并删除其中的任何内容。 如果需要的话,这只能是 DEBUG 代码(用#if DEBUG 括起来)。 还要向您的项目添加一个构建脚本,该脚本在每次构建时都会执行此操作。
I would suggest emptying/deleting your folder from your website. Have your website on startup create/verify the folder, and on shutdown to clean it up and remove anything in it. This can be DEBUG code only (wrap in #if DEBUG) if so needed. Also add a build script to your project that does this every time it is built also.
如果您对临时文件夹的父项目执行操作,您可以尝试隐藏该文件夹。
http://msdn.microsoft.com/en-us /library/x2398bf5(VS.80).aspx
If you perform operations on a parent project of the temporary folder, you may try cloaking the folder.
http://msdn.microsoft.com/en-us/library/x2398bf5(VS.80).aspx
我不确定这是否适合您,但如果您从 VSS 中排除临时文件夹(使用 VSS UI 删除 VSS 内的文件夹),则进入其中的文件不应再次被“拾取”。
I'm not sure if this is an option for you, but if you exclude your temporary folder from VSS (delete the folder inside VSS using the VSS UI), the files that go into it should not get "picked up" again.
您使用的是 ASP.NET 网站还是 ASP.NET Web 项目? 这种差异足以解决或促进这个问题。
网站,喜欢扫描文件系统和自动签入。
项目,仅检查您告诉他们的内容。
此外,Visual Source Safe 已经过时了,最新的源代码控制系统允许您执行您所要求的操作。 根据我的经验,SVN 和 TFS 2008 SP1 确实如此。
您还可以尝试右键单击该文件夹并选择“排除”,但对于网站,我相信这会重命名该文件夹。
Are you using ASP.NET Website or ASP.NET Web Project? The difference is significant enough to solve or promote this problem.
Websites, love to scan the file system and auto checkin.
Projects, checkin only what you tell them to.
Also Visual Source Safe is pretty out dated, most recent source control systems allow you to do what you are asking. SVN and TFS 2008 SP1 do from my experience.
You can also try to right click and pick "Exclude" on the folder, but in the case of a Website I believe this renames the folder.
我想您已经找到了 MS 回到 VS2008 和 MVC 中的项目的主要原因之一。
我已经很久没有使用VSS了(主要是因为它现在确实已经过时了),但是大多数源提供程序都允许您将文件和文件夹排除在提供程序的设置中,而不是在受控项目中。
如果您可以切换到 Web 项目而不是网站,那么就这样做,否则我会考虑更新您的源代码控制提供程序,因为使用 Vault、CSV、SVN、Git、VSTS 等可以轻松进行此类排除(以只举几个名字)。
I think you've found one of the main reasons MS went back to projects in VS2008 and in MVC.
It's been a long time since I've used VSS (mainly because it's really out of date now), but most source providers let you exclude files and folders as a setting of the provider, rather than the project under control.
If you can switch to a Web Project rather than a WebSite then do so, otherwise I'd look at updating your source control provider, as this sort of exclusion is easy with Vault, CSV, SVN, Git, VSTS and so on (to name but a few).