When I create a service, what I normally do is to set the default directory
where the main assembly is located.
Right at the beginning of OnStart(), I add the following:
Process pc = Process.GetCurrentProcess();
Directory.SetCurrentDirectory
(pc.MainModule.FileName.Substring(0,pc.MainModule. FileName.LastIndexOf(@"\")
));
By the way, if I remember correctly, the default directory for a Service is
the \System32 dir. Since you tried to place the PDB(s) in the \System32, I'm
not sure it will solve your particular problem.
Grive a try ;-)
José
"David Evans" <ne********@inaplex.com> a écrit dans le message de
news:ur**************@TK2MSFTNGP10.phx.gbl...
Hi
I have a service created in VS.NET, which I can install and run quite
happily. After teh service is running, I can attach and run the debugger.
However, if I set a breakpoint in the IDE the break point is (presumably)
hit, but after a long pause there is an error that says "Source code
cannot be found"
I have tried:
putting the .pdb file into the install direcory and Windows\System32
installing into the default bin\Debug directory that VS.NET builds in
Any help appreciated - debugging using trace is no fun...
Regards
David