1

I am having a problem with my application. The application works perfect on my development machine. It fails, without any errors on the live server. The page loads, but the code doesn't execute apparently.

I have been stuck on this for a while because I can't figure out how to get any information on the problem. There are no errors, so my custom errors settings in web.config are not helping.

I looked around online and I heard there was some remote debugging tool. The article was from .Net 1.0. I tried to follow it, but its not going to work because I am using a shared server. I do not have permissions to start the remote debugger on the server side.

I tried creating some output text files with variable contents, but the files are not being created either. They are created on my development machine, but never show up on the server, again with no error.

I have no idea how I'm supposed to figure out what is going on, because I'm not able to step through the code once it's on the live server.

Is there anyway to step through, or debug the code once I've published it? If I spent the extra money on a VPS, would that allow me to debug on the server side? I'm assuming I could just install Visual Studio on the VPS and step through the program. I've never used a VPS before.

7
  • 1
    Better, look at ASP.NET Health Monitoring. You are almost certainly getting exceptions that you didn't bother to log. Commented May 27, 2015 at 0:24
  • True, I'm not logging anything, as far as I know. This is my first ASP.Net application for school. I will check out the Health Monitoring and see if it helps. Thanks. Commented May 27, 2015 at 0:30
  • It's pretty simple because it's built in. If you can get to the system event log, it's pretty trivial to set up Health Monitoring. You don't even need to do anything much more than enable it, because the defaults all "do the right thing". Commented May 27, 2015 at 0:32
  • It also means you don't have to bother to learn a real logging framework, which for this case, you probably don't need. You'll probably find there's some simple environmental difference between development and the server. Commented May 27, 2015 at 0:32
  • I'm thinking this error is in my code, not that an exception is being thrown. The page is setup to use a code, kind of like tinyurl.com. An example: domain.com/SDFDFRDF. I grab the current URL and read the last 8 bytes, which is the code. Then I do something with the code. It works perfect on the development machine. But on the live server, it is now directing me to a page that says "Directory Not Found". The live server is treating SDFDFRDF as a real directory, where the development server doesn't do that. I could use a query string, but this is the way tinyurl implements the feature. Commented May 27, 2015 at 1:16

1 Answer 1

1

Unless you do something very special in your code, it is unlikely that it behaves differently on your server compared to your workstation.

It is more likely that the configuration on the server is not correct.

You are saying your

code doesn't execute

How do you know that? You should first confirm that your code is actually executing.

you are also saying:

it is now directing me to a page that says "Directory Not Found"

a web server it never looking for directories, it is looking for resources, check your iis http logs what substatus codes are you getting?, enable Failed Request Tracing and review the logs.

Using Process Monitor can also help determine what the web server is doing.

Start with a very simple page and see whether that executes fine.

What I'm saying is, first debug/fix the execution environment before trying to debug your code.

You would never install Visual Studio on a server, the default installation of a Windows Server doesn't even allow you to install it. Instead you can use remote debugging components on the server and use your local Visual Studio to debug remotely.

Sign up to request clarification or add additional context in comments.

3 Comments

There can be environmental differences. Obscure recent example: App Pool running as different users between dev and production, so the user had access to the private key of a certificate on dev, but non in production. In production, an exception was thrown when the private key was accessed.
@JohnSaunders - That's my point, in most cases the problem are environmental differences. But to find out a user lacks permissions, you don't need to debug the application, use Process Monitor. Debugging can be helpful, but is often not needed.
I have tried the remote debuggers, the problem is that I cannot install them on a shared server to my knowledge. I really wish I was able to use them. I might decide to move to a VPS just for this reason.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.