两个主机但单个代码库的两个web.config [英] Two web.config on two hosting but single code base

查看:68
本文介绍了两个主机但单个代码库的两个web.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我有一个ASP.Net应用程序,必须设置两个站点,它们应该分别拥有自己的web.config相同的结构,但具有不同的appsetting值。



两个站点都将使用单一代码库。因为我不想为了维护目的而保留两个代码库。部署应该在DDL的单个位置。



请告知如何实现它。





谢谢



我尝试过:



目前正在寻找解决方案。

Hello,

I have a ASP.Net application and have to setup two sites which should have own web.config separately with same structure but with different appsetting values.

And both site will use single code base. Because i don't want to keep two code base for maintenance purpose. Deployment should be at single location of DDLs.

Please advise how to achieve it.


Thanks

What I have tried:

Currently Im looking for solution.

推荐答案

这取决于您 - 您需要维护两个单独的web.config副本并将相应的一个加载到相应的站点。这是一个管理/配置问题,不是可以通过软件或一般开发解决的问题。



软件可以提供帮助的唯一方法是编写应用程序进行部署该站点通过FTP并包含该部署的正确Web.Config文件。但是......对于一个简单的配置问题来说这太过分了!
That's down to you - you need to maintain two copies of separate web.config and load the appropriate one to the appropriate site. That's a management / configuration issue, not something that can be solved with software, or development generally.

The only way software could help is if you wrote an app to deploy the site via FTP and include the correct Web.Config file with that deployment. But ... that's rather overkill for a simple configuration issue!


这取决于你。如果您拥有并控制Web服务器,则可以这样做。这取决于您正在使用的网络服务器。



如果您使用第三方提供商托管此网站,例如GoDaddy,A2,HostGator,......或者其他一些,你必须和他们谈谈。很可能只允许两个不同站点的单个代码库,或者如果它受到支持,你将不得不与他们交谈以专门设置它。
That's up to you. If you're owning and controlling the web server, this is possible. It depends on the web server you're using.

If you're hosting this site with a 3rd party provider, like GoDaddy, A2, HostGator, ... or some other, you have to talk to them. Chances are good having a single code base for two different sites isn't going to be allowed, or you're going to have to talk to them to specially set it up IF it is supported.


这篇关于两个主机但单个代码库的两个web.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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