S
Sam Kong
Hello!
Recently I had a strange problem with Visual C# 2005 beta 1.
When I ran(F5 key) a program, <#if DEBUG> statement was not working.
It ran as RELEASE mode.
So I had to manually define DEBUG to make #if DEBUG work.
When I first started the project, this problem didn't exist.
The problem started to exist in the middle of doing the project.
Today, I decided to figure out what went wrong.
Finally I pinpointed the cause of the problem.
In the *.csproj file, I had the following lines.
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>.\bin\Debug\</OutputPath>
<DefineConstants>
</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<Optimize>true</Optimize>
<OutputPath>.\bin\Release\</OutputPath>
<DefineConstants>
</DefineConstants>
</PropertyGroup>
I compared them with normal ones and found out that they should be like the
following.
(See <DefineConstants> lines)
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>.\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>//***DIFFERENT
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<Optimize>true</Optimize>
<OutputPath>.\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>//***DIFFERENT
</PropertyGroup>
I've never edited the file (Actually I haven't opened it.)
I don't think there's a interface to modify it from VC#.
I think something affected it.
Has anyone experienced same thing?
TIA.
Sam
Recently I had a strange problem with Visual C# 2005 beta 1.
When I ran(F5 key) a program, <#if DEBUG> statement was not working.
It ran as RELEASE mode.
So I had to manually define DEBUG to make #if DEBUG work.
When I first started the project, this problem didn't exist.
The problem started to exist in the middle of doing the project.
Today, I decided to figure out what went wrong.
Finally I pinpointed the cause of the problem.
In the *.csproj file, I had the following lines.
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>.\bin\Debug\</OutputPath>
<DefineConstants>
</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<Optimize>true</Optimize>
<OutputPath>.\bin\Release\</OutputPath>
<DefineConstants>
</DefineConstants>
</PropertyGroup>
I compared them with normal ones and found out that they should be like the
following.
(See <DefineConstants> lines)
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>.\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>//***DIFFERENT
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<Optimize>true</Optimize>
<OutputPath>.\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>//***DIFFERENT
</PropertyGroup>
I've never edited the file (Actually I haven't opened it.)
I don't think there's a interface to modify it from VC#.
I think something affected it.
Has anyone experienced same thing?
TIA.
Sam