路口或虚拟目录为Web应用程序? [英] Junctions or Virtual Directories for Web Applications?

查看:164
本文介绍了路口或虚拟目录为Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到路口在许多项目中引用的共享code的常用方法。不过,我还没有看到他们的web应用程序之前。

I see that junctions are a common way of referencing shared code in many projects. However, I have not seen them used in web applications before.

我们的团队正在探索有利于路口放弃虚拟目录,以简化我们构建过程的可能性。我的目标是编译为了使对这种变化做出明智的决定利弊清单。

Our team is exploring the possibility of abandoning virtual directories in favor of junctions to simplify our build process. My goal is to compile a list of pros and cons in order to make an informed decision regarding this change.

是不是更合适使用的Web应用程序项目或路口虚拟目录?

环境是ASP.NET,IIS6 / IIS7,VS.NET。

Environment is ASP.NET, IIS6/IIS7, VS.NET.

推荐答案

虚拟目录与路口就像比较苹果和梨:它们都创建一个类目录的虚拟副本,以及苹果和梨都是水果,但比较到此为止。

Virtual directories vs. junctions is like comparing apples to pears: they both create sort of a virtual copy of a directory, as well as apples and pears are both fruits, but the comparison ends there.

首先,由于Windows Vista中新的东西是符号链接(这基本上是一样的路口,也可以指向一个文件或远程SMB路径)。

First off, since Windows Vista, the new thing is symbolic links (which are essentially the same as junctions but can also point to a file or remote SMB path).

符号链接使您能够,例如,共享除了它的Web.config和样式的Web应用程序的每个部分。这一点虚拟目录可以不这么做。

Symbolic links enable you to, for example, share every part of a web application except its Web.config and a stylesheet. This is something virtual directories can never do.

此外,虚拟目录参加ASP.NET的变化监测。如果您尝试,并从应用程序中删除(文件或)目录,例如,ASP.NET杀死你的应用程序请求完成后,造成会话损失等。如果而不是使用一个虚拟目录,你用一个符号链接时,变化不会被察觉,你的应用程序将继续搅动。

Also, virtual directories participate in ASP.NET's change monitoring. If you try and delete (a file or) directory from within your application, for instance, ASP.NET kills your app after the request completes, resulting in loss of session, etc. If instead of using a virtual directory, you use a symbolic link, the change will not be noticed and your app will keep on churning.

要记住,符号链接是不是在Windows日常功能,这一点很重要。是的,你可以看到一个文件或目录在资源管理器链接,但它不是立即可见它是什么联系。此外,从code就更难看到,如果一个文件被链接的,所以如果你不小心删除了被链接到由百万符号链接文件,所有这些符号链接突然停止现有的

It's important to keep in mind that symbolic links are not an everyday feature in Windows. Yes, you can see that a file or directory is linked in Explorer, but it's not instantly visible to what it is linked. Also, from code it is much harder to see if a file is linked, so if you accidently delete the file that is being linked to from a million symbolic links, all those symbolic links suddenly 'stop existing'.

符号链接也加快了同一应用程序的多个实例的部署,因为你所要做的就是复制了几个实际的文件,然后唯一创建符号链接到源文件所有的休息。

Symbolic links also speed up deployment of multiple instances of the same application, since the only thing you have to do is copy a few actual files, and then create symbolic links to the source files for all the rest.

这篇关于路口或虚拟目录为Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆