Click here to Skip to main content
11,802,762 members (71,651 online)
Rate this: bad
Please Sign up or sign in to vote.
I get an error when calling a com object.
Somehow when i have optimize code disabled there seems to be a difference between debugging and just running the debug build.

When debugger is attached from startup it crashes with the AccessViolationException.
When debugger is attached after starting the app no error
Just starting the app No Error.

How can debugging from Visual studio 2010 make such a difference?
Posted 7-Jun-11 1:48am
SAKryukov at 7-Jun-11 14:19pm
Nothing, nothing can be said without your code. With the unmanaged, it can happen by million reasons.
You either need to post a small sample of code (including unmanaged) which manifest the problem or realize that you're completely on your own. Any other ideas? I doubt it...

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hope this[^] will give you an idea.
iceball12 at 7-Jun-11 10:44am
Well i did understand what is causing it, as i am calling into unmanagement code.
However the question is why does it only happen when debugger is attached (from start of app , so from vs ) and when optimizer is disabled.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 KrunalRohit 366
1 OriginalGriff 365
2 F-ES Sitecore 295
3 CPallini 270
4 Sergey Alexandrovich Kryukov 239
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,695
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 7 Jun 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100