Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
GeneralRe: Registry Entry made with advapi32.dll instead of .NET Pin
JimDel17-Apr-09 11:56
JimDel17-Apr-09 11:56 
GeneralRe: Registry Entry made with advapi32.dll instead of .NET Pin
harold aptroot17-Apr-09 12:28
harold aptroot17-Apr-09 12:28 
GeneralRe: Registry Entry made with advapi32.dll instead of .NET Pin
JimDel17-Apr-09 14:05
JimDel17-Apr-09 14:05 
GeneralRe: Registry Entry made with advapi32.dll instead of .NET Pin
Luc Pattyn17-Apr-09 14:15
sitebuilderLuc Pattyn17-Apr-09 14:15 
GeneralRe: Registry Entry made with advapi32.dll instead of .NET Pin
JimDel17-Apr-09 14:19
JimDel17-Apr-09 14:19 
GeneralRe: Registry Entry made with advapi32.dll instead of .NET Pin
Luc Pattyn17-Apr-09 14:24
sitebuilderLuc Pattyn17-Apr-09 14:24 
GeneralRe: Registry Entry made with advapi32.dll instead of .NET [modified] Pin
JimDel17-Apr-09 14:44
JimDel17-Apr-09 14:44 
QuestionOptimization kills program. Pin
harold aptroot17-Apr-09 8:18
harold aptroot17-Apr-09 8:18 
It started with a release build that failed to work.
Or actually it is a bit more subtle but it took a lot of work to find that out.

So, the story.
I'm writing a dll that is part of a bigger program. When I'm debugging it, it works fine, nothing wrong. But when I run the release build it first takes 100% cpu and after a while it crashes. This only happens if I run the release build - so neither when I try to debug the release build and ignore the warning that it's optimized, nor when I run the debug build directly without the debugger attached.
Have tried:
* copying the "debug" dll to the release folder of the exe (works)
* replacing all #if DEBUG by #if true (does not work)
* enabling full debug info for the release build (no effect)
* disabling optimization for the release build (works!)

But merely knowing this doesn't solve the problem. I'd like the code to be optimized.
So here is the real question: what is going on here? what could cause this?
I have a small amount of reflection going on, but nothing to serious, just things like enumerating custom attributes and calling a default ctor.. No dirty tricks with MSIL and Reflection.Emit. It does use SetWindowsHookExA but in a completely different part of the program than the failing part which shouldn't have any effect at all - but maybe it does? And it uses Xna.Framework and Xna.Framework.Game (but they should work, they always used to), which is why I'm compiling for x86 only (not AnyCPU).



AnswerRe: Optimization kills program. Pin
Colin Angus Mackay17-Apr-09 8:47
Colin Angus Mackay17-Apr-09 8:47 
GeneralRe: Optimization kills program. Pin
harold aptroot17-Apr-09 8:56
harold aptroot17-Apr-09 8:56 
AnswerRe: incorrect code kills program? Pin
Luc Pattyn17-Apr-09 9:07
sitebuilderLuc Pattyn17-Apr-09 9:07 
GeneralRe: incorrect code kills program? Pin
harold aptroot17-Apr-09 9:18
harold aptroot17-Apr-09 9:18 
GeneralRe: incorrect code kills program? Pin
Luc Pattyn17-Apr-09 9:36
sitebuilderLuc Pattyn17-Apr-09 9:36 
GeneralRe: incorrect code kills program? Pin
harold aptroot17-Apr-09 9:58
harold aptroot17-Apr-09 9:58 
GeneralRe: incorrect code kills program? Pin
Luc Pattyn17-Apr-09 10:11
sitebuilderLuc Pattyn17-Apr-09 10:11 
GeneralRe: incorrect code kills program? Pin
harold aptroot17-Apr-09 10:15
harold aptroot17-Apr-09 10:15 
AnswerRe: Optimization kills program. Pin
S. Senthil Kumar18-Apr-09 9:46
S. Senthil Kumar18-Apr-09 9:46 
GeneralRe: Optimization kills program. Pin
harold aptroot18-Apr-09 11:02
harold aptroot18-Apr-09 11:02 
GeneralRe: Optimization kills program. Pin
S. Senthil Kumar18-Apr-09 21:27
S. Senthil Kumar18-Apr-09 21:27 
GeneralRe: Optimization kills program. Pin
harold aptroot19-Apr-09 0:55
harold aptroot19-Apr-09 0:55 
GeneralRe: Optimization kills program. Pin
S. Senthil Kumar19-Apr-09 1:11
S. Senthil Kumar19-Apr-09 1:11 
GeneralRe: Optimization kills program. Pin
harold aptroot19-Apr-09 1:13
harold aptroot19-Apr-09 1:13 
GeneralRe: Optimization kills program. Pin
S. Senthil Kumar19-Apr-09 1:19
S. Senthil Kumar19-Apr-09 1:19 
GeneralRe: Optimization kills program. Pin
harold aptroot19-Apr-09 1:30
harold aptroot19-Apr-09 1:30 
GeneralRe: Optimization kills program. Pin
S. Senthil Kumar19-Apr-09 1:49
S. Senthil Kumar19-Apr-09 1:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.