I have a website that works perfectly when deployed on my local machine, but when it is deployed, it doesn't. It is being deployed on a testing server that I can't debug on, so what checks can I do to see what's happening?
I've tried changing all references in my local web.config to the IP address of the test server, to access the database there, but I'm not sure which ones need to be changed - ie. should any refence to 'localhost' in my local web.config be changed to the
IP address of the test server in order to enable me to use the database attached to it? (this is for CRM, so when I say database, I mean CRM really - there isn't a connection string tag in the web.config)
I am not familiar with CRM but when you tell its not working, is it showing any error message or not showing any thing for the web site. Did you set customErrors mode = Off in the web.config.
Try it so it might show you what is the error and where is it coming from.
I can't see any errors. What happens is that the user picks 2 values from 2 drop downs, then these values are saved to the database. However, the values are not being saved. When I refresh the page, they are not there, and they are not in the database.
I checked the web.config, and customErrors mode = Off.
The code is working perfectly on my local machine, the logic is correct etc. and the values are correctly saved to my local database. However, something must be going wrong somewhere when it is deployed to the test server as these values aren't saved. I
would like to somehow debug while pointing at the database of the test server. I can't debug the code locally on the test server.
I never thought its possible to debug code from server. What I do in this situation is write messages to Windows event viewer to know which code path is executing. So you can place a message before inserting the values and print the values and what is happinging
after te insert or its going to any error.
Check this link for information about logging in to event viewer
Place meaning full messages so you can see the exact problem. Also provide your code which is failing the insertion on the forum so others can also see what wrong in it. As you told its only problem with insertion, I feel its some thing to do with your database
or insertion process.
ASPdeveloper...
Member
3 Points
26 Posts
Website working locally, but not when deployed
Dec 07, 2012 08:57 AM|LINK
I have a website that works perfectly when deployed on my local machine, but when it is deployed, it doesn't. It is being deployed on a testing server that I can't debug on, so what checks can I do to see what's happening?
I've tried changing all references in my local web.config to the IP address of the test server, to access the database there, but I'm not sure which ones need to be changed - ie. should any refence to 'localhost' in my local web.config be changed to the IP address of the test server in order to enable me to use the database attached to it? (this is for CRM, so when I say database, I mean CRM really - there isn't a connection string tag in the web.config)
Thanks.
swapna.anu
Contributor
2658 Points
745 Posts
Re: Website working locally, but not when deployed
Dec 07, 2012 09:29 AM|LINK
Hi
I am not familiar with CRM but when you tell its not working, is it showing any error message or not showing any thing for the web site. Did you set customErrors mode = Off in the web.config.
Try it so it might show you what is the error and where is it coming from.
Hope this helps.
ASPdeveloper...
Member
3 Points
26 Posts
Re: Website working locally, but not when deployed
Dec 07, 2012 09:45 AM|LINK
Thanks for your reply.
I can't see any errors. What happens is that the user picks 2 values from 2 drop downs, then these values are saved to the database. However, the values are not being saved. When I refresh the page, they are not there, and they are not in the database.
I checked the web.config, and customErrors mode = Off.
The code is working perfectly on my local machine, the logic is correct etc. and the values are correctly saved to my local database. However, something must be going wrong somewhere when it is deployed to the test server as these values aren't saved. I would like to somehow debug while pointing at the database of the test server. I can't debug the code locally on the test server.
swapna.anu
Contributor
2658 Points
745 Posts
Re: Website working locally, but not when deployed
Dec 07, 2012 10:36 AM|LINK
Hi
I never thought its possible to debug code from server. What I do in this situation is write messages to Windows event viewer to know which code path is executing. So you can place a message before inserting the values and print the values and what is happinging after te insert or its going to any error.
Check this link for information about logging in to event viewer
http://www.jimmycollins.org/blog/?p=388
http://www.codeproject.com/Articles/39218/How-To-Create-a-Windows-Event-Log-and-Write-your-C
Place meaning full messages so you can see the exact problem. Also provide your code which is failing the insertion on the forum so others can also see what wrong in it. As you told its only problem with insertion, I feel its some thing to do with your database or insertion process.
Hope this helps.
Ruchira
All-Star
42888 Points
7020 Posts
MVP
Re: Website working locally, but not when deployed
Dec 09, 2012 11:49 AM|LINK
Hello,
You have two options.
1. You can enable remote debugging in live server
http://msdn.microsoft.com/en-us/library/bt727f1t.aspx
2. You can configure a logging mechanism such as log4net and see where the error occurs. My blog post will help you to configure log4net.
http://ruchirac.blogspot.com/2012/10/configure-log4net-with-aspnet-logging.html
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.