Difference between Debug and Release compilation?

  • Thread starter Thread starter Jonas Hallgren
  • Start date Start date
J

Jonas Hallgren

Hello,

Is there any general tips on how to solve this problem: my Debug
version runs fine but when I do a Release version I get error
messages!?

I'm hoping it is a simple option somewhere or a flag I can set...

Regards,
Jonas
 
Is there any general tips on how to solve this problem: my Debug
version runs fine but when I do a Release version I get error
messages!?

What error messages?
I'm hoping it is a simple option somewhere or a flag I can set...

Well...you could always set your build configuration to "Debug". :)

Normally, if the code is written correctly, Debug and Release builds work
exactly the same. If you don't tell us what the actual problem is, it's
not likely we can tell you what you need to fix.

Pete
 
What error messages?


Well...you could always set your build configuration to "Debug". :)

Normally, if the code is written correctly, Debug and Release builds work
exactly the same. If you don't tell us what the actual problem is, it's
not likely we can tell you what you need to fix.

Pete

Hi,

Thanks for replying.

What I have done is to build an UserControl based on the DShowNET dll
in order to enumerate audio input devices and mixers/pins and relevant
settings.
The control then generates a menu for me, requiring me to first choose
a Device, in my case an SB X-Fi card. Then I can choose "line in" or
"microphone" etc. But while this works fine in Debug, either in debug
from VS2005 or running the executable in the Debug folder, the Release
version throws an ex when I want to choose/change from microphone to
"line in" or any other available choice.

The message is

System.NotImplementedException
at DShowNET.IAMAudioInputMixer.put_Enable(Boolean fEnable)
at DirectX.Capture.AudioSource.set_Enabled(Boolean value)
at etc etc

Strange since it works fine in debug mode...

Did this give you any clue to what could be happening here?

Regards,
Jonas
 
Hi again :)
Well...you could always set your build configuration to "Debug". :)

If I set my UserControl to Debug and my main app to Release it works
fine. I am a bit worried that the problem is in the third party dll of
which I have no control. I'll post this to the developer at
codeproject and hope for a reply!

Thanks again!
Jonas
 
[...]
The message is

System.NotImplementedException
at DShowNET.IAMAudioInputMixer.put_Enable(Boolean fEnable)
at DirectX.Capture.AudioSource.set_Enabled(Boolean value)
at etc etc

Strange since it works fine in debug mode...

Did this give you any clue to what could be happening here?

A clue? Sure. An answer? No. You didn't really post that much
information. The full stack trace might be useful, and of course seeing
the relevant code might be useful as well.

What I *do* see is that you're getting an exception that states that you
are attempting an operation that is not implemented in the object
(probably a COM object) you're trying to use. Based on what little stack
trace you did post, it appears that some audio input source is having it's
"enabled" state changed and that the source in question doesn't support
changing that state.

But that in no way answers why it works in Debug and not in Release. I'd
say the most likely reason is that in your Debug build the operation
simply doesn't happen. However, I suppose it's also possible that the
value being passed in for the value is somehow different, and that the
operation is supported only for a certain value of the setting.

All I can say is that you should be thankful you're getting an exception.
:) Many debug/release bugs don't manifest themselves in such an obvious
way. Here, you should be able to wait for the exception to happen in the
debugger, look at the call stack (starting at the deepest end of the
stack, where the exception actually happened, and working your way back)
for anything that might be depending on the debug/release characteristic
of the build and see what it might be doing differently. You may or may
not have to inspect all of the code all the way up the stack.

If you post the full call stack AND you post all of the code related to
that call stack that you have, there is a small possibility someone here
might be able to identify the problem for you. But I wouldn't get your
hopes up. The more code you post, the more likely it is that the problem
will actually be findable in the code you post, but the less likely it is
that someone will have the time and inclination to do the search for you.
It's a bit of a Catch-22 for you there. :)

You posted in a different message that it works if your UserControl is
Debug but your application is Release and that from that you conclude that
the problem is in a third-party DLL. Unless "your UserControl" is in fact
that third-party DLL, then I don't think that's the right conclusion. If
it works fine with your UserControl as Debug and everything else Release,
but not when the UserControl is *also* Release, then to me that strongly
suggests a bug in the UserControl itself.

Pete
 
[...]
The message is
System.NotImplementedException
at DShowNET.IAMAudioInputMixer.put_Enable(Boolean fEnable)
at DirectX.Capture.AudioSource.set_Enabled(Boolean value)
at etc etc
Strange since it works fine in debug mode...
Did this give you any clue to what could be happening here?

A clue? Sure. An answer? No. You didn't really post that much
information. The full stack trace might be useful, and of course seeing
the relevant code might be useful as well.

What I *do* see is that you're getting an exception that states that you
are attempting an operation that is not implemented in the object
(probably a COM object) you're trying to use. Based on what little stack
trace you did post, it appears that some audio input source is having it's
"enabled" state changed and that the source in question doesn't support
changing that state.

But that in no way answers why it works in Debug and not in Release. I'd
say the most likely reason is that in your Debug build the operation
simply doesn't happen. However, I suppose it's also possible that the
value being passed in for the value is somehow different, and that the
operation is supported only for a certain value of the setting.

All I can say is that you should be thankful you're getting an exception.
:) Many debug/release bugs don't manifest themselves in such an obvious
way. Here, you should be able to wait for the exception to happen in the
debugger, look at the call stack (starting at the deepest end of the
stack, where the exception actually happened, and working your way back)
for anything that might be depending on the debug/release characteristic
of the build and see what it might be doing differently. You may or may
not have to inspect all of the code all the way up the stack.

If you post the full call stack AND you post all of the code related to
that call stack that you have, there is a small possibility someone here
might be able to identify the problem for you. But I wouldn't get your
hopes up. The more code you post, the more likely it is that the problem
will actually be findable in the code you post, but the less likely it is
that someone will have the time and inclination to do the search for you.
It's a bit of a Catch-22 for you there. :)

You posted in a different message that it works if your UserControl is
Debug but your application is Release and that from that you conclude that
the problem is in a third-party DLL. Unless "your UserControl" is in fact
that third-party DLL, then I don't think that's the right conclusion. If
it works fine with your UserControl as Debug and everything else Release,
but not when the UserControl is *also* Release, then to me that strongly
suggests a bug in the UserControl itself.

Pete

Hi and again thanks for the reply.

I am aware of my post lacking in relevant info and I actually scrapped
the whole idea, because I realised that I tried to use a control
designed for capturing audio and video to file, just to get hold of
the ability to choose audio input ports/pins/devices/mixers or
whatchamacallit.

Instead I found MixerLib at http://www.limegreensocks.com/dshow/ which
does exactly what I want and also taught me a great deal about
programming InterOp.

In the future I will try to make my questions more to the point :)

Regards,
Jonas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top