MSBuild

S

Scott M.

This may not be the right place for this, but I can't find an MSBuild NG, so here goes...

I'm trying to understand why this particular condition is placed in my build files:

<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

Is it there just in case of user stupidity? How would you set your configuration to an empty string in the first place? And, if you could, why would you?

Thanks.
 
W

Walter Wang [MSFT]

Hi Scott,

The statement's purpose is to set a default value for the property
"Configuration" if it's not explicitly set by user. Therefore if you didn't
specify "/p:Configuration=Debug" on the command line, it will have the
value "Debug" by default.

Note the condition attribute could be either specified on a PropertyGroup
node or a single property node:

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == ''
">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>2a7074be-72dd-4b92-9d44-eb6023010ec7</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ConsoleApplication1</RootNamespace>
<AssemblyName>ConsoleApplication1</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>


In above file, the first ProjectGroup node is defining several common
properties and only the property "Configuration" has default value "Debug"
specified. The second ProjectGroup node has a condition which uses the
Configuration and Platform properties to determine if its enclosed
properties such as "DebugSymbols", "DebugType" should have which values.

Hope this helps.

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

Walter Wang [MSFT]

Hi Scott,

I'm writing to check the status of this post. Please feel free to let me
know if there's anything else I can help. Thanks.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Scott M.

Hi Walter,

Thanks for your reply and yes, it does answer my question. I guess I wasn't
thinking about non-IDE development when I posted.

-Scott
 
W

Walter Wang [MSFT]

Hi Scott,

Thanks very much for your follow-up.

By the way, I just noticed an old post of yours two months ago seems not
captured by our internal tool and we have missed it:

http://msdn.microsoft.com/newsgroups/managed/default.aspx?dg=microsoft.publi
c.dotnet.framework.aspnet&tid=8f814feb-b5d9-4d36-9e02-df4226cb67f9&m=1&p=1

We're sorry for this.

If you still need to work on it, please feel free to let me know. I will
try my best to help.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Scott M.

Thanks Walter. I am all set on that older issue you mentioned, but I do
have 2 unanswered posts in the "microsoft.public.dotnet.framework.adonet"
from 11/12 that I'd like to get closure on.

-Scott
 
W

Walter Wang [MSFT]

Hi Scott,

I've found those two posts you mentioned. I've informed my colleague to
handle them shortly.

By the way, those two posts were posted using "(e-mail address removed)" instead
of your register nospam posting alias "(e-mail address removed)", that's why they
haven't been recogonized by our internal tool.

Please feel free to email me directly if you think any of your managed
posts are left unhandled.

Thanks for using MSDN Managed Newsgroup Support Service!

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Scott M.

Thanks Walter! Now it makes sense why posts I've made on my laptop get
answered but posts from my desktop don't! I'll update my desktop's account
settings.
 

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

Top