Line numbers changed in stack traces?

Line numbers changed in stack traces?

Hi there,

I couldn't see this in the FAQ, and I couldn't find a search button for the forum, so my apologies if this is an oft answered question!

If I run my (failing) unit tests with NCover, then stack traces produce line numbers which are incorrect. I guess this is caused by the runtime instrumentation of the code. Is there any way around this? My workaround for now will be to run the nunit tests outside of NCover, then run them again inside NCover to generate coverage information.

So far, I've been very impressed with NCover, the How-To videos and articles are great, saved me a lot of time in getting up and running.

Cheers,

Andy


RE: Line numbers changed in stack traces?

Andy,

NCover instrumentes the IL just before the IL is executed for the first time, so the binaries on disk are never touched (i.e. NCover doesn't affect line numbers). Line numbers come from the PDBs, and sometimes VS will generate PDBs that are off by one or two lines. How large of a discrepancy are you seeing?

Stephen