简体   繁体   English

ASP.Net服务器调试

[英]ASP.Net Server Debugging

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. 没有错误,因此我在web.config中的自定义错误设置没有帮助。

I looked around online and I heard there was some remote debugging tool. 我在网上环顾四周,听说那里有一些远程调试工具。 The article was from .Net 1.0. 本文来自.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? 如果我将多余的钱花在了VPS上,那可以让我在服务器端进行调试吗? I'm assuming I could just install Visual Studio on the VPS and step through the program. 我假设我可以在VPS上安装Visual Studio并逐步执行该程序。 I've never used a VPS before. 我以前从未使用过VPS。

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. 一个从不寻找目录的Web服务器,它在寻找资源,检查iis http logs ,获取什么子状态代码,启用“ 失败请求跟踪”并查看日志。

Using Process Monitor can also help determine what the web server is doing. 使用Process Monitor还可以帮助确定Web服务器在做什么。

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. 您永远不会在服务器上安装Visual Studio,Windows Server的默认安装甚至不允许您安装它。 Instead you can use remote debugging components on the server and use your local Visual Studio to debug remotely. 相反,您可以在服务器上使用远程调试组件 ,并使用本地Visual Studio进行远程调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM