Is there a way to list all the build targets available in a build file?

Using MSBuild 2.0/3.5 : Custom Task You could write a custom msbuild task like this : using System; using System.Collections.Generic; using Microsoft.Build.BuildEngine; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace MSBuildTasks { public class GetAllTargets : Task { [Required] public String ProjectFile { get; set; } [Output] public ITaskItem[] Targets { get; set; } public override bool Execute() … Read more

When should we call a target using ‘DependsOnTargets’ and ?

MSBuild provides different ways to call target : MSBuild task CallTarget task DependsOnTarget target attribute BeforeTargets and AfterTargets target attributes in MSBuild 4 Using CallTarget is an explicit approach, you start at your first target and call explicitly each target in the order you want. Whereas DependsOnTargets is an implicit approach, MSBuild infers the calling … Read more

test if an MSBuild property is defined?

There exists common method for overriding properties. Sample from C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets <PropertyGroup> <TargetFrameworkIdentifier Condition=”‘$(TargetFrameworkIdentifier)’ == ””>.NETFramework</TargetFrameworkIdentifier> <TargetFrameworkVersion Condition=” ‘$(TargetFrameworkVersion)’ == ” “>v4.0</TargetFrameworkVersion> </PropertyGroup> If you will try to get value from $(NeverDefinedProperty) you just get an empty string. Can you describe the problem you want to solve?

Configure MSBuild output path

Using MSBuild command line, you can specify the output path like below: C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe <path_to_project_file> /t:Build /p:OutDir=c:\custom_build_out\;Configuration=PRODUCTION;Platform=x64 Note: If you change the order of specifying the OutDir property for /p, this doesn’t work. The OutDir property is for specifying a full path to an alternate directory. OutputPath is for a relative directory. It has … Read more

MSBuildExtensionsPath32 not set correctly?

MSBuildExtensionsPath32 is set internally by MSBuild. (BuildEngine.BuildPropertyGroup.SetExtensionsPathProperties) But you could override it by setting an environment variable. SET MSBuildExtensionsPath=”C:\Program Files\MSBuild” Or you could override the value in your project file : <PropertyGroup> <MSBuildExtensionsPath>C:\Users\madgnome\Desktop\msbuild</MSBuildExtensionsPath> <!– It works too with relative path –> <!–<MSBuildExtensionsPath>..\msbuild</MSBuildExtensionsPath>–> </PropertyGroup> <Import Project=”$(MSBuildBinPath)\Microsoft.CSharp.targets” /> <Import Project=”$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets” />

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)