Scenario:
- Single SQL Server with 2 instances ->
.\test
&.\live
- Single IIS server with 2 websites ->
test
&live
test
website's web.config
points to the .\test
SQL server instance, live
website points to .\live
. The SQL Server instances are identical in every way, i.e. DB names, SQL username / password, etc. The only way they differ is by the ports they listen on.
We have the following code deployed to the test
website:
_logger.Debug("connection string: " + _context.Database.Connection.ConnectionString);
_context.Database.ExecuteSqlCommand("stored_procedure @param");
When we check the logfile after this code has executed, it shows that the connection string is pointing to the .\test
instance, as expected. But a SQL Profiler trace shows that stored_procedure
is being executed against the .\live
instance.
We can't figure out why or how this is happening, any help?