Skip to content

Instantly share code, notes, and snippets.

View goyalmohit's full-sized avatar

mohit goyal goyalmohit

  • Pune, India
View GitHub Profile
@goyalmohit
goyalmohit / defining-msbuild-properties-project-file-samples-02
Last active December 3, 2017 14:01
Defining MSBuild Properties - Project File Sample 02
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildDir>C:\Source\Repo\MyRepo\Bin</BuildDir>
<Optimize>false</Optimize>
</PropertyGroup>
</Project>
@goyalmohit
goyalmohit / defining-msbuild-properties-project-file-samples-03
Last active December 3, 2017 14:04
Defining MSBuild Properties - Project File Sample 03
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildDir>C:\Source\Repo\MyRepo\Bin</BuildDir>
</PropertyGroup>
<PropertyGroup>
<Optimize>false</Optimize>
</PropertyGroup>
</Project>
@goyalmohit
goyalmohit / defining-msbuild-properties-project-file-samples-04
Last active December 3, 2017 14:30
Defining MSBuild Properties - Project File Samples 04
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{974DF0E9-8535-4E6D-96DD-BF7CCF2B2480}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ConsoleApp02</RootNamespace>
<AssemblyName>ConsoleApp02</AssemblyName>
@goyalmohit
goyalmohit / defining-msbuild-properties-project-file-samples-05
Last active December 3, 2017 14:32
Defining MSBuild Properties - Project File Samples 05
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildDir>C:\Source\Repo\MyRepo\Bin</BuildDir>
<Optimize>false</Optimize>
</PropertyGroup>
<Target Name = "Compile">
<!-- Log the file name of the output file directory -->
<Message Text="The output file directory is $(BuildDir)"/>
</Target>
</Project>
@goyalmohit
goyalmohit / print-system-path-in-msbuild.proj
Created December 3, 2017 20:45
Understanding MSBuild Properties - Project File Samples 07
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name = "Compile">
<!-- Prints value of environment Variable PATH -->
<Message Text="PATH = $(Path)"/>
</Target>
</Project>
@goyalmohit
goyalmohit / defining-msbuild-properties-project-file-samples-06.proj
Last active December 3, 2017 20:45
Defining MSBuild Properties - Project File Samples 06
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildDir>C:\Source\Repo\MyRepo\Bin</BuildDir>
</PropertyGroup>
<PropertyGroup>
<BuildDir>C:\Source\Repo\MyRepo\Bin\Debug</BuildDir>
</PropertyGroup>
</Project>
@goyalmohit
goyalmohit / override-environment-variable-in-msbuild.proj
Last active December 3, 2017 20:52
Understanding MSBuild Properties - Project File Samples 08
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Path>C:\Source</Path>
</PropertyGroup>
<Target Name = "Compile">
<!-- Prints value of defined property PATH -->
<Message Text="PATH = $(Path)"/>
</Target>
</Project>
@goyalmohit
goyalmohit / understanding-msbuild-global-properties-01.proj
Last active December 4, 2017 10:54
Understanding MSBuild Properties - Project File Samples 09
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name = "Compile">
<Message Text="OutputDir = $(OutputDir)"/>
<Message Text="Configuration = $(Configuration)"/>
</Target>
</Project>
@goyalmohit
goyalmohit / understanding-msbuild-global-properties-02.proj
Created December 4, 2017 11:05
Understanding MSBuild Properties - Project File Samples 10
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputDir>C:\Temp</OutputDir>
</PropertyGroup>
<Target Name = "Compile">
<Message Text="OutputDir = $(OutputDir)"/>
<Message Text="Configuration = $(Configuration)"/>
</Target>
@goyalmohit
goyalmohit / understanding-msbuild-use-condition-with-property
Created December 4, 2017 11:27
Understanding MSBuild Properties - Use conditions to define default values
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>