post-build-event

VS2010: Can we have multiple if in post-build event?

女生的网名这么多〃 提交于 2019-12-31 21:21:09
问题 Can we have something like this: if "Debug"=="$(ConfigurationName)" ( goto :nocopy ) else if "Release"=="$(ConfigurationName)" ( del "$(TargetPath).config" copy "$(ProjectDir)\App.Release.config" "$(TargetPath).config" ) else if "ReleaseBeta"=="$(ConfigurationName)" ( del "$(TargetPath).config" copy "$(ProjectDir)\App.ReleaseBeta.config" "$(TargetPath).config" ) else if "ReleaseProduction"=="$(ConfigurationName)" ( del "$(TargetPath).config" copy "$(ProjectDir)\App.ReleaseProduction.config" "

Updating local nuget package on post-build event

假如想象 提交于 2019-12-31 13:14:11
问题 I have my local nuget library repository separately both for my personal and work releted class libraries. I have created some of the nuget packages for the libraries which are no longer in development. I did this only for them because I do not know how to update them automatically as soon as my project builds. I have figured that all the work is being done by nuget command line with Visual Studio Command Prompt. So I can easily do the work I needed (of course I would know commands perfectly

How to execute a PowerShell script only before a web deploy Publish task in VS 2012?

允我心安 提交于 2019-12-28 05:21:30
问题 Currently I have a post-build event configured in my web project using Visual Studio 2012 like this: This basically calls a PowerShell script to add a copyright notice to every .cs file. What I'd like to do is to execute this powershell script only before Publishing the web app to the remote server. Doing so I won't experience a delay every time I need to debug the project. Do you know of any way of accomplishing this? According to Sayed's answer, I customized a specific publish profile and

Visual Studio Post Build does not like my conditional

为君一笑 提交于 2019-12-23 18:22:56
问题 I have a post build conditional that looks like this: if $(ConfigurationName)==Release ( echo Update $(TargetName) to be non conflicting "$(SolutionDir)ILMerge\RummageTypeRenamer.exe" -f XamlGeneratedNamespace.GeneratedInternalTypeHelper -t XamlGeneratedNamespace.GeneratedInternalTypeHelper$(TargetName) $(TargetName).dll del $(TargetName).dll ren $(TargetName).Runmage.dll $(TargetName).dll ) This runs fine if I take off the condition and the parens. But if I run it as is, I get the error: The

Post-build powershell script

安稳与你 提交于 2019-12-22 06:04:05
问题 I have the following post-build event: powershell Set-ExecutionPolicy Unrestricted powershell -file "$(SolutionDir)Obfuscation\_obfuscate.ps1" "$(SolutionDir)" "$(ProjectDir)" powershell Set-ExecutionPolicy Restricted and PS script beginning with: param ( [string]$slnDir, [string]$projectDir ) when MSBuild trys to run it, my first parameter "$(SolutionDir)" is splitted in two parameters because the solution path contains a space character: D:\Projects\Dion2 Mercurial\repo\Dion2Web\ . So my

Post-build powershell script

自闭症网瘾萝莉.ら 提交于 2019-12-22 06:03:35
问题 I have the following post-build event: powershell Set-ExecutionPolicy Unrestricted powershell -file "$(SolutionDir)Obfuscation\_obfuscate.ps1" "$(SolutionDir)" "$(ProjectDir)" powershell Set-ExecutionPolicy Restricted and PS script beginning with: param ( [string]$slnDir, [string]$projectDir ) when MSBuild trys to run it, my first parameter "$(SolutionDir)" is splitted in two parameters because the solution path contains a space character: D:\Projects\Dion2 Mercurial\repo\Dion2Web\ . So my

VS PostBuild Event - Copy file if it exists

大城市里の小女人 提交于 2019-12-21 07:09:30
问题 Is there a simple way to copy a file in a post-build event for a Visual Studio project, but only if the file exists? (i.e. don't fail the build if the file doesn't exist) I've tried some options using xcopy. But I feel so stupid - I can't seem to get my head around what switches I might need with xcopy. 回答1: Use "IF" command: IF EXIST file.txt xcopy file.txt [destination_folder]\ /Y 回答2: Also without the IF EXIST but using the /U option of XCOPY xcopy source_file_name dest_folder /u /y 来源:

How to checkout-copy-checkin a file in TFS using Post-build event?

前提是你 提交于 2019-12-21 06:23:48
问题 I have a Project holding server controls. Whenever I make changes to it I want to be able to Build in Release mode and have the output DLL (and its documentation Xml file) copied to a folder in Team Foundation Server. I have come out with a post-build event that: Checks both DLL and XML out. Copies them to the TFS folder Checks them back in with some comments. This is the script: if $(ConfigurationName) == Release "$(DevEnvDir)tf" checkout /lock:none C:\CommonAssemblies\$(TargetFileName) if $

How to checkout-copy-checkin a file in TFS using Post-build event?

回眸只為那壹抹淺笑 提交于 2019-12-21 06:23:11
问题 I have a Project holding server controls. Whenever I make changes to it I want to be able to Build in Release mode and have the output DLL (and its documentation Xml file) copied to a folder in Team Foundation Server. I have come out with a post-build event that: Checks both DLL and XML out. Copies them to the TFS folder Checks them back in with some comments. This is the script: if $(ConfigurationName) == Release "$(DevEnvDir)tf" checkout /lock:none C:\CommonAssemblies\$(TargetFileName) if $

Call a method from a build event

时间秒杀一切 提交于 2019-12-21 04:57:21
问题 is it possible to make a method call from a postbuild event? namespace Test { public class MyClass { public void DoSomething() { // Do something } } } Of course this class resides in a project whose build events I specify. Is there a way to call DoSomething as a postbuild event? 回答1: You can't do this directly, but you could include a small executable as part of your solution, with a reference to the method you want to call. Once the solution builds, trigger it to fire the executable you just