简体   繁体   English

附加到Visual Studio上的进程

[英]Attach to process on Visual Studio

I trying to do something very simple here. 我想在这里做一些非常简单的事情。 I use Visual Studio 2012. I created simple visual Studio class called BLA. 我使用Visual Studio 2012.我创建了一个名为BLA的简单visual Studio类。 The whole code is below. 整个代码如下。

using System;
using System.Collections.Generic;
using System.Text;

namespace BLA
{
    public class Class1
    {
        public void hit() {
            Console.Write("sdf");
        }
    }
}

I build it without errors. 我构建它没有错误。 I put a breakpoint in "Console.Write("sdf")" and then try attach to process to iexplore.exe. 我在“Console.Write(”sdf“)”中放置一个断点,然后尝试附加到iexplore.exe进程。 The process it attached but I get an error The breakpoint will not currently be hit. 它附加的过程,但我得到一个错误断点当前不会被命中。 No symbols have been loaded for the document. 没有为文档加载符号。

I tried searching in google and stackoverflow I got many answers but none of them solved my problem. 我尝试在谷歌搜索和stackoverflow我得到了很多答案,但没有一个解决了我的问题。

Any idea how? 知道怎么样?

What kind of application are you building, you mention that you attach to iexplore.exe is it a webapplication? 您正在构建什么样的应用程序,您提到您附加到iexplore.exe它是一个Web应用程序?

You could allways try System.Diagnostics.Debugger.Break() to give you a debugging option. 你总是可以尝试System.Diagnostics.Debugger.Break()来给你一个调试选项。

您必须创建类Class1的对象并从该对象调用方法hit()

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

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