2

I have verified in the project properties and solution properties, configuration manager, that my solution and project are set to x64 Release. The output path is "bin\x64\Release\".

I have the following in app.xaml.cs (it's a C# WPF application), which was working shortly ago:

#if (!DEBUG)
        Mouse.OverrideCursor = Cursors.None;
#endif

Currently, in Release mode, the middle line is grayed out. Removing the "!" restores it.

When running, in Release mode, the mouse cursor is not hidden, and this section is seeminly skipped over.

Visual Studio, in another project, works well and fine with Debug vs. Release modes. Has anyone seen this behaviour, and does anyone have any ideas on how to fix it?

4

2 回答 2

2

Check your constant definitions, DEBUG can be turned on even for release configuration

Right click on the project, select properties, on the Build sheet in the general section make sure the "Define DEBUG constant" box is not checked.

于 2012-11-30T19:23:49.787 回答
1

"Debug" and "Release" mode are just two different configurations that are created by default by Visual Studio. There are a number of settings for each configuration set when they are created, but all of them can be changed manually. You can change whether or not the compiler will compile the project with debugging information, whether optimizations are enabled, and whether or not the DEBUG precompiler directive is defined. It would seem that the debug derictive was defined on your Release build.

于 2012-11-30T19:25:27.787 回答