Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Webconfig becomes part of compile?

I'll explain in steps what happened...

1. My manager moved the production database to a new server. It went from server YYY to XXX, for example
2. He changed the webconfig on the server to point to the new database. All good so far.
3. I wanted to update our production webserver with the new code. I don't publish directly to the server. I publish locally and just copy the Bin folder to prod (along with whatever files like JS, etc)
4. This is the publish settings:
User generated image
5. I published locally in Release mode. Copied the Bin folder. I didn't replace the webconfig on the production webserver. It was pointing to the correct database XXX.
6. I went to the site and the site was down with an error that looked like it was a connection to the database.
7. This is what I did to fix it. I went back to the code and in the Web.Release.Config, I saw the connection string as being the old one; YYY. I changed the connection string to XXX (new one). Compiled, published, copied the Bin folder and this time it worked. Note that I didn't replace the Production webconfig file
User generated image
So, how does this work... I didn't replace the webconfig on the prod server, I only changed it locally, compiled , republished and only copied the Bin folder.
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Hi Camillia,

"that looked like it " does not help much really. Any idea about the error? Also, can you look in to server event logs via Eventvwr?
Also please check date/time stamp on the web.config on Prod (In case someone else updated it).

Regards,
Chinmay.
Avatar of Camillia

ASKER

It was an error in a class that checks user access to the database.

My manager had changed the web config last week.

So I'm guessing compiling doesn't do anything with web config. Maybe it was just a bad publish I had and republishing worked.
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Very odd. Maybe it was just a bad publish. Thanks for the link.

As always, thanks :)