这个永久的SQLExpress连接字符串来自哪里(而不是web.config)?

时间:2021-04-11 19:11:08

Today I noticed that in my ConfigurationManager.ConnectionStrings the very first instance is .\SQLEXPRESS. I remembered explicitly removing this entry from my web.config so I checked again, but didn't find a thing. Then I did a search over my entire solution, not a single match.
Where the hell is this connection string coming from and how can I remove it?

今天我注意到在我的ConfigurationManager.ConnectionStrings中,第一个实例是。\ SQLEXPRESS。我记得明确地从我的web.config中删除了这个条目所以我再次检查,但没有找到任何东西。然后我搜索了整个解决方案,而不是单个匹配。这个连接字符串来自哪里,我该如何删除?

2 个解决方案

#1


21  

It's in there by default, pulled in from your machine config file. To get rid of it just put

它默认存在于您的机器配置文件中。摆脱它只是把它

<clear />

Above your first connection string to remove it.

在您的第一个连接字符串上方将其删除。

#2


2  

It comes from the machine.config.

它来自machine.config。

However you may remove it, if you wish.

但是,如果您愿意,可以将其删除。

#1


21  

It's in there by default, pulled in from your machine config file. To get rid of it just put

它默认存在于您的机器配置文件中。摆脱它只是把它

<clear />

Above your first connection string to remove it.

在您的第一个连接字符串上方将其删除。

#2


2  

It comes from the machine.config.

它来自machine.config。

However you may remove it, if you wish.

但是,如果您愿意,可以将其删除。