I am trying to exclude files when automated deployment is run from TFS 2013 using build definition file.
The arguments (MSBuild Arguments) I am using in Build Definition are as follows:
/p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=WMSVC /p:MSDeployUseChecksum=true /p:AuthType=NTLM
/p:AllowUntrustedCertificate=True /p:MSDeployServiceUrl=https://servername/msdeploy.axd
/p:DeployIisAppPath="TestSite" /p:UserName=
In the build definition i have mentioned Configuration as "Any CPU|Release" and corresponding to that I have mentioned ExcludeFoldersFromDeployment in csproj:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExcludeFilesFromDeployment>bin\some.dll</ExcludeFilesFromDeployment>
<ExcludeFoldersFromDeployment>someFolder</ExcludeFoldersFromDeployment>
</PropertyGroup>
When I right click on project and click publish it excludes these files successfully, but when i try to run this through build definition it doesn't exclude these files and folders.
Please help. I have tried using wpp.targets file also. But no luck.