虚拟目录中的IIS Config文件 [英] IIS Config file in virtual directory

查看:172
本文介绍了虚拟目录中的IIS Config文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个网站都有相同的代码,但不同的应用程序设置。
我想将我的应用程序设置放在位于虚拟目录中的单独配置文件中。这将允许我拥有所有站点共享的所有代码的单个副本,每个站点具有不同的虚拟目录。

I have multiple websites that all have the same code, but different app settings. I want to place my app settings in a separate configuration file that is located in a virtual directory. This will allow me to have a single copy of all of the code shared across all of the sites with a different virtual directory for each site.

不幸的是,当我尝试配置它,IIS不在处理​​虚拟目录时处理配置文件。

Unfortunately, when I try to configure this, IIS doesn't process the config file when it is in a virtual directory.

如果您有解决方案,我将非常感谢您的帮助。

If you have a solution to this, I would appreciate your help.

推荐答案

无法使用虚拟目录(甚至是当前网站之外的文件;只有当前文件夹或子目录文件夹)。

It's not possible to use a virtual directory (or even files outside of the current website; only the current folder, or a sub-folder).

在项目之间共享设置的一种可能方法是在构建时执行此操作 - 通过应对它,或使用VS中的链接文件将它复制到发布时的文件夹。

One possible way to share setting across projects would be to do it at build-time - either by coping it in, or using a Linked File in VS to have it copied to the folder on publish.

如果你真的需要在服务器上使用这个功能,你可以试试(虽然我不能说它有多好用) Junction

If you really need this functionality on the server, you could try (though I can't say how well it would work) a Junction.

这篇关于虚拟目录中的IIS Config文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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