简体   繁体   English

在不安装Visual Studio的情况下在计算机上调试代码

[英]Debug code on machine without installing Visual Studio

I have one test machine that my program needs to run on that machine. 我有一台测试计算机,我的程序需要在该计算机上运行。 It fails to run but I don't know the reason. 它无法运行,但我不知道原因。

I want to debug the code on that machine to check the issue without installing Visual Studio 2012 on that machine. 我想在该计算机上调试代码以检查问题,而不在该计算机上安装Visual Studio 2012。 I have the source code of the program. 我有程序的源代码。 What should I do? 我该怎么办?

Thanks. 谢谢。

You will need to use the remote debugging tools, go to your start menu, find your visual studio and expand it, find Visual Studio Tools and then remote debugging folder. 您将需要使用远程调试工具,转到“开始”菜单,找到Visual Studio并将其展开,找到Visual Studio Tools,然后找到远程调试文件夹。

When you have this copy the x86 or x64 folder over to the machine you want to debug on and run the application or web page and msvsmon.exe. 将x86或x64文件夹复制到要调试的计算机上,然后运行应用程序或网页和msvsmon.exe。

Then on your machine from the debugging menu attach to process, and then target the machine that you want to run against. 然后从调试菜单上的计算机上附加到进程,然后将您要运行的计算机作为目标。

Then look for the process you want to debug 然后寻找您要调试的过程

You can use remote debugging and debug the remote code on your machine as you have the source code. 您可以使用远程调试,并在拥有源代码的情况下在计算机上调试远程代码。 You can also write exception logs in remote application to know what error has occurred at what place in your code. 您还可以在远程应用程序中编写异常日志,以了解在代码中的什么位置发生了什么错误。 For remote debugging the see the detailed explanation about remote debugging as under from MSDN article. 有关远程调试,请参见MSDN文章中有关远程调试的详细说明。

How to: Enable Remote Debugging 如何:启用远程调试

Visual Studio provides support for remote debugging, that is, the ability to debug an .exe on another computer connected to your network. Visual Studio提供了对远程调试的支持,即可以在连接到网络的另一台计算机上调试.exe的功能。 The Use remote machine property on the Debug page of the Project Designer enables remote debugging of an .exe. 项目设计器的“调试”页面上的“使用远程计算机”属性启用.exe的远程调试。 When this option is selected, you must specify the name of the machine on which the .exe will run. 选择此选项时,必须指定将在其上运行.exe的计算机的名称。 The location of the .exe on the remote machine must match the value of the Make exe path property, which is on the Compile page of the Project Designer. .exe在远程计算机上的位置必须与Make exe路径属性的值匹配,该属性位于Project Designer的“编译”页面上。 In order to debug on a remote machine, the following conditions must be met: 为了在远程计算机上进行调试,必须满足以下条件:

  • The remote machine must have debugger components installed. 远程计算机必须安装了调试器组件。
  • The user of the local machine needs to be in the Debugger Users group on the remote machine. 本地计算机的用户必须位于远程计算机上的“调试器用户”组中。
  • The .exe must be in a shareable directory on the remote machine. .exe必须位于远程计算机上的可共享目录中。 For more information, see Remote Debugging Setup . 有关更多信息, 请参见远程调试设置

To enable remote debugging 启用远程调试

  1. Make sure that the remote machine is properly configured for remote 2. debugging. 确保正确配置了远程计算机以进行远程调试。2。 For more information, see Remote Debugging Setup . 有关更多信息, 请参见远程调试设置
  2. With a project selected in Solution Explorer, on the Project menu click Properties. 在解决方案资源管理器中选择一个项目后,在“项目”菜单上单击“属性”。
  3. Click the Debug tab. 单击调试选项卡。
  4. Select the Use remote machine check box. 选择使用远程计算机复选框。
  5. In the Use remote machine field, enter the name of the remote machine, using the format \\domain\\machinename. 在“使用远程计算机”字段中,使用\\ domain \\ machinename格式输入远程计算机的名称。

I would check remote debugging. 我会检查远程调试。 You can find information about here . 您可以在此处找到有关信息。

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

相关问题 使用自定义URL在Visual Studio上进行调试(但在本地计算机上) - Debug on Visual Studio with custom url (but in local machine) 如何在没有Visual Studio的情况下调试? - How to debug without Visual Studio? 尽管安装了扩展,为什么我无法在 Visual Studio Code 中调试 C# 代码? - Why can't I debug C# code in Visual Studio Code despite installing extensions? 没有Visual Studio的情况下如何调试Windows服务? (在客户的计算机上) - How can I debug a windows service without Visual Studio? (on a client's machine) 无需在远程计算机上安装Visual Studio,就可以在dll中远程执行C#单元测试 - Execute C# unit Tests in dll remotely without installing Visual Studio on remote machine 在 Visual Studio 中调试没有管理员权限的应用程序 - Debug application without admin rights in Visual Studio 使用代码在 Visual Studio 调试控制台中更改颜色 - Changing color in Visual Studio Debug Console With Code 如何在Visual Studio代码上调试AspNet 5应用程序? - How to debug AspNet 5 app on Visual Studio Code? 在调试模式下在Visual Studio 2008中编辑代码 - Editing code in Visual Studio 2008 in debug mode Dotnet手表与调试Visual Studio代码 - Dotnet watch with debug Visual Studio Code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM