Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't step Into and debug the serviced component source code

I have developed a COM+ Component in C# be inheriting ServicedComponent. Here is how it looks like:

    [Transaction(TransactionOption.Required)]
    [ClassInterface(ClassInterfaceType.AutoDual)]
    [EventTrackingEnabledAttribute(true)]
    [JustInTimeActivation]
    [ObjectPooling(Enabled = true, MinPoolSize = 10, MaxPoolSize = 30, CreationTimeout = 15000)]
    [Synchronization]

    class MyComponent: System.EnterpriseServices.ServicedComponent
    {
        [AutoComplete(true)]
        public string getHello()
        {//2nd breakpoint
            ContextUtil.SetComplete();
            return "HelloWorld";
        }
    }

I have another test project from which I call this component.

class Program
{
static void Main(string[] args)
{
MyComponent myComp = new MyComponent();
myComp.getHello();//1st Breakpoint
}
}

I am not able to reach 2nd Breakpoint. This was working before I switched to VS 2012. Strange thing is after switching to 2012 its no longer working in VS 2010 too.

I've already tried,

  • Attach to process
  • Unchecked "Enable Just My Code" in debug settings

Can someone please give direction from here?

UPDATE 1

From the links given by Mike, I tried symchk for my DLL in the same folder where DLL and PDB files were there. It fails with error saying PDB mismatched or not found. I don't know how to resolve this error.

like image 793
Eternal Noob Avatar asked Jul 10 '15 17:07

Eternal Noob


People also ask

How do I debug a service in Visual Studio?

Start Visual Studio with administrative credentials so you can attach to system processes. (Optional) On the Visual Studio menu bar, choose Tools, Options. In the Options dialog box, choose Debugging, Symbols, select the Microsoft Symbol Servers check box, and then choose the OK button.

How do I debug a .NET service?

Start the service (you can use net start , or start it in the Services window). You should see a dialog box like the following: Select Yes, debug <service name>. In the Just-In-Time Debugger window, select the version of Visual Studio you want to use for debugging.

How do you enter a breakpoint in Visual Studio code?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.


1 Answers

You may be missing the .pdb file in your project.

Check this microsoft link out for an explanation: https://msdn.microsoft.com/en-us/library/yd4f8bd1(vs.71).aspx

like image 72
TopBanana9000 Avatar answered Sep 21 '22 22:09

TopBanana9000