在 ASP .NET 中使用多个分支

发布于 2024-08-12 03:51:00 字数 717 浏览 4 评论 0原文

我看过其他几篇与此类似的帖子(即 https: //stackoverflow.com/questions/5237/solutions-for-working-with-multiple-branches-in-asp-net),但我遇到的几个问题似乎与其他类似的帖子不同。

我有一个 ASP .NET 应用程序,它使用本地主机之外的虚拟目录。代码中有几个地方需要引用虚拟目录的名称,因此虚拟目录需要就位并正确命名才能正常工作。我还使用 httpd.conf 文件来格式化 URL 以避免查询字符串混乱。

话虽这么说,我刚刚发布了我的应用程序,现在需要创建一个分支环境来修复错误,只要实时代码中存在错误并且我不想上传开发代码。

问题在于,我需要能够轻松地与开发代码并行运行分支代码,而无需每次要加载分支代码时都对 IIS 和配置文件进行大量工作。缺点是并行环境需要有虚拟目录并使用相同的 httpd.conf(用于 URL 格式化)。

我不认为 Cassini 可以工作,因为我需要 SSL,当然......httpd.conf 和虚拟目录需要仍然存在。

在我看来,完美的解决方案是使用相同的 httpd.conf 和相同的虚拟目录运行到本地主机的并行网站...但我运行的是 XP Pro,他们不会“执行”多个网站。

I've seen several other posts similar to this (namely https://stackoverflow.com/questions/5237/solutions-for-working-with-multiple-branches-in-asp-net) but there are several issues that I have that seem to be different than other similar posts.

I have an ASP .NET application that uses a virtual directory off of localhost. There are several spots in the code where I need to reference the name of the virtual directory so the virtual directory needs to be in place and named correctly in order for it to work. I'm also using my httpd.conf file to format my URLs to avoid cluttered querystrings.

That being said, I just published my application and now need to create a branched environment for bug-fixes whenever there is a bug in the live code and I don't want to upload the dev code.

The trouble is that I need to be able to easily run my branched code parallel to my dev code without needing to do a bunch of work with IIS and config files every time I want to load in my branched code. The drawbacks are that the parallel environment needs to have the virtual directory in place and work with the same httpd.conf (for URL formatting).

I don't think Cassini would work because I need SSL and of course...the httpd.conf and the virtual directories would need to still be in place.

The perfect solution in my mind would be to run a parallel website to localhost with the same httpd.conf and the same virtual directory...but I'm running XP Pro and they don't "do" multiple websites.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

残龙傲雪 2024-08-19 03:51:00

让您的构建过程在每次构建运行时创建虚拟目录。

我为此使用了 NantContrib 的 mkiisdir 任务

使用这种方法,您无法同时运行多个分支,但您可以通过构建要运行的分支来快速在分支之间切换。

Have your build process create the virtual directory each time the build is run.

I've used NantContrib's mkiisdir task for this.

With this approach you can't run multiple branches simultaneously, but you can quickly switch between branches by building the branch you want to run.

著墨染雨君画夕 2024-08-19 03:51:00

我会像上面那样做,但是您可以将其连接到构建事件后的解决方案中,但这不会是并行的更多快速切换。我认为有一个注册表黑客可以在 iis 中获取多个站点,或者如果没记错的话,如果您通过它起作用的脚本创建了一个附加站点,那么只是 GUI 被锁定了。或者更好的解决方案是升级到 Windows 服务器,并为不同的端口构建不同的分支。

I would do as above, but you could hook it into your solutions post build event, but this wouldn't be parallel more a quick switch. I think there's a registry hack out there to get multiple sites in iis or if memory serves if you create an additional site through a script it works, it's just the GUI that's locked down. Or the better solution would be upgrade to windows server, and have different branches build to different ports.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文