IIS7揪错连接字符串 - 跨站点和过程? [英] iis7 pulling wrong connection string - cross site and process?

查看:140
本文介绍了IIS7揪错连接字符串 - 跨站点和过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有相同的Windows 2008 R2 64位服务器,SQL服务器Web版上运行两个网站。这两个网站都只有在连接字符串从不同的数据库拉低数据相同。

这两个网站在不同的应用程序池中运行 - 无论是.NET 2,经典的管道,32位 - 而该网站是很旧的在2005年大部分的数据访问是在编译的DLL的bin目录

如果我打印出我使用的连接字符串通过调用ConfigurationManager.ConnectionStrings [名。ConnectionString的我得到存储在Web.config文件中的正确连接字符串。

但是,如果我打印出来的数据访问组件我从网站上的其他副本的连接字符串连接字符串。此连接字符串仅在其他网站的web.config文件中设置 - 无处本网站

ASP.Net如何才能在不同的进程从不同的网站访问连接字符串?我迷路了,以什么在源或解决这个问题,它似乎集市。

有任何想法非常感谢。这两个网站完美的作品并排的Windows 2003服务器上。


解决方案

这个问题现在已经通过更改网站之一的连接字符串键解决。仍然不确定为什么会发生在所有但它仿佛具有相同名称的连接字符串到网站之间的不同的应用程序池在同一台服务器上被共享。非常感谢您的帮助。

I have two websites running on the same Windows 2008r2 64bit server, SQL Server Web edition. Both sites are identical with just the connection string pulling the data from a different database.

Both sites are running in different application pools - both .net 2, classic pipeline, 32bit - and the website is quite old being developed back in 2005. Most of the data access is in compiled dll's in the bin directory.

If I print out the connection string I'm using by calling ConfigurationManager.ConnectionStrings["name"].ConnectionString I get the correct connection string which is stored in the web.config file.

However if I print out the connection string from the data access component I get the connection string from the other copy of the website. This connection string is only set in the other websites web.config file - nowhere in this website.

How can ASP.Net be accessing a connection string from a different website in a different process? I'm lost as to what either the source or solution to this issue is, it seems bazaar.

Many thanks for any ideas. Both sites works perfectly side by side on Windows 2003 server.

解决方案

This issue has now been resolved by changing the connection string key on one of the websites. Still unsure why it happened at all but its as though the connection strings with same name are being shared between to websites on the same server in different application pools. Many thanks for the help.

这篇关于IIS7揪错连接字符串 - 跨站点和过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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