assembly always gets built optimized<[email protected]>

  • Thread starter Thread starter Kousik Chatterjee
  • Start date Start date
K

Kousik Chatterjee

Hi Robert,
I recently came across the same problem. I am not able to debug parts of the code when I attach my visual studio debugger to an already launched process.
Did you find a way to get across it ? Do I need to modify the build settings for the particular assembly to solve the problem ?

Thanks and Regards,
Kousik


-----------------
03-Apr-07 02:30:25

I did not mention an important detail (since I didn't think that it
matters). I attach to the process that references my assembly after
the process is started. When I do not attach visual studio to the
process but instead start the process directly from vs by hitting F5 I
infact am able to debug. Also note that the probelm with "Cannot
evaluate expression because the code of the current method is
optimized." only happens with the one project. The sourcecode of all
other projects in the same solution can be debugged just fine no
matter if I attach later or start the process with F5.
What does this hint? How could I narrow the source of this evil down?
Does it have to do something with the visual studio hosting process
(wich only is used when starting the process with F5) ? Or could it
have to do with the working folder or the loaded symbols?
----------------
 
Hello Kousik,

Do u have .pdb file next to your assembly which you are trying to debug?!


---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


KC> Hi Robert,
KC>
KC> I recently came across the same problem. I am not able to debug
KC> parts of the code when I attach my visual studio debugger to an
KC> already launched process.
KC>
KC> Did you find a way to get across it ? Do I need to modify the build
KC> settings for the particular assembly to solve the problem ?
KC>
KC> Thanks and Regards,
KC> Kousik
KC> -----------------
KC> 03-Apr-07 02:30:25
KC> I did not mention an important detail (since I didn't think that it
KC> matters). I attach to the process that references my assembly after
KC> the process is started. When I do not attach visual studio to the
KC> process but instead start the process directly from vs by hitting F5
KC> I
KC> infact am able to debug. Also note that the probelm with "Cannot
KC> evaluate expression because the code of the current method is
KC> optimized." only happens with the one project. The sourcecode of all
KC> other projects in the same solution can be debugged just fine no
KC> matter if I attach later or start the process with F5.
KC> What does this hint? How could I narrow the source of this evil
KC> down?
KC> Does it have to do something with the visual studio hosting process
KC> (wich only is used when starting the process with F5) ? Or could it
KC> have to do with the working folder or the loaded symbols?
KC> ----------------
 
Back
Top