Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7046521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:39:37+00:00 2026-05-28T02:39:37+00:00

I’m using environment variables in my VS2010 projects ; this works fine. But I’d

  • 0

I’m using environment variables in my VS2010 projects; this works fine.

But I’d like to have default values that are used whenever the environment variable doesn’t exist. Is this possible?

Edit/Solved: my property sheet looks like this (THIRDPARTY_ROOT can be overridden by setting it in the environment):

<?xml version="1.0" encoding="utf-8"?>
<!--
 * Property sheet for 3rd party libraries
 *
 * - The BOOST_VER variable should be set to the same value as in common.mk
 * - The THIRDPARTY_ROOT variable can be overridden by an environment variable
 *   with the same name.
 *
 -->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets" />
  <PropertyGroup Label="UserMacros">
    <BOOST_VER>boost_1_48_0</BOOST_VER>
    <THIRDPARTY_ROOT Condition="'$(THIRDPARTY_ROOT)' == '' ">C:\local\3rdparty</THIRDPARTY_ROOT>
  </PropertyGroup>
  <PropertyGroup />
  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalIncludeDirectories>$(THIRDPARTY_ROOT)\$(BOOST_VER)</AdditionalIncludeDirectories>
    </ClCompile>
    <Link />
  </ItemDefinitionGroup>
  <ItemGroup>
    <BuildMacro Include="BOOST_VER">
      <Value>$(BOOST_VER)</Value>
    </BuildMacro>
    <BuildMacro Include="THIRDPARTY_ROOT">
      <Value>$(THIRDPARTY_ROOT)</Value>
    </BuildMacro>
  </ItemGroup>
</Project>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:39:38+00:00Added an answer on May 28, 2026 at 2:39 am

    One possible solution is to provide default values in your project file.

    You can do this by using a Condition attribute when defining this variable in your project file to indicate that it should be used only if the property has no value.

    For example, if ToolsPath is your environment variable, you could add this code to your project file:

    <ToolsPath Condition="'$(ToolsPath)' == '' ">
        C:\Tools
    </ToolsPath>
    

    (MSDN Reference)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have thousands of HTML files to process using Groovy/Java and I need to
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.