post-build-event

How can I remove tralling backslash from $(ProjectDir)?

倖福魔咒の 提交于 2019-11-29 13:33:49
I have a command line like this in my post-build event: aspnet_regiis -pef connectionStrings "$(ProjectDir)" -prov "DataProtectionConfigurationProvider" But aspnet_regiis is returning a failure because the tralling \ in the directory. Pass full name, path + web.config doesn't work either. How can I solve this? Thangadurai You can use the TrimEnd function to trim the trailing slash character $(ProjectDir.TrimEnd('\')) I found this option in this post 来源: https://stackoverflow.com/questions/36975106/how-can-i-remove-tralling-backslash-from-projectdir

Copy built assemblies (including PDB, .config and XML comment files) to folder post build

谁都会走 提交于 2019-11-29 12:29:59
Is there a generic way I can get a post-build event to copy the built assembly, and any .config and any .xml comments files to a folder (usually solution relative) without having to write a post-build event on each project in a solution? The goal is to have a folder that contains the last successful build of an entire solution. It would be nice to use the same build solution over multiple solutions too, possibly enabling/ disabling certain projects (so don't copy unit tests etc). Thanks, Kieron You can set common OutputPath to build all projects in Sln in one temp dir and copy required files

VS 2012: Post Build xcopy error 2

冷暖自知 提交于 2019-11-29 11:22:46
问题 i want to make VS copy the .lib-file it created after the build process to a specific folder. So i went to the project config, post-build event, and entered the following command: if exist $(TargetPath) xcopy "$(TargetPath)" "C:\Users\Incubbus\Documents\Visual Studio 2010\My Libraries\z.lib" /Y But instead of copying the process fails after i click "build" and i receive the following error: error MSB3073: The command "if exist C:\Users\Incubbus\Documents\Visual Studio 2010\My Libraries

Post build event depending on configuration name in new ASP.NET 5 project

时光总嘲笑我的痴心妄想 提交于 2019-11-29 04:34:48
I'm writing a unified project for 3 smart TVs. I have also 3 configurations created in Visual Studio . Now I want to execute some CLI scripts depending on selected configuration. The problem is in new ASP.NET 5 project I don't have an editor for post build events. I know I have to do this in project.json . What I found is: "scripts": { "postbuild": "" } But using this one I can't create different CLI scripts for different configurations. I found also: "configurations": { }, And I guess this is probably what I want, but... How to use it? Intellisense has no power here and also I wasn't lucky

In Visual Studio 2012 (C#) How to Create Custom Macros available in Post Build

こ雲淡風輕ζ 提交于 2019-11-29 00:02:54
I want to add in a Post-build event commandline in my Visual Studio 2012 C# project. I have a number of projects in my solution and I would like to add to the list of macros available with "Macros>>". How can I achieve this? For instance I have the command line: "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool.exe" sign /f MYPFXFILEPATH /p MYPASSWORD /t http://timestamp.verisign.com/scripts/timstamp.dll $(TargetDir)$(TargetFileName) I would hate to copy and paste that into every project. I would like to place the first part into a macro so that I would have: $(SignCommandLinePrefix)

How can you access the Visual Studio solution level platform from a C# project's build event?

夙愿已清 提交于 2019-11-28 12:04:22
We have a large VS 2010 solution that is mostly C# code but there are a few native DLLs that various C# projects depend upon (including our unit testing DLL). We're in the processing of trying to support both 32-bit and 64-bit versions of our libraries. So we're now build the native DLLs as 32-bit and 64-bit. The problem is that a lot of our C# project's have post-build events that copy the required native DLLs into the project's TargetDir. Now that we have two different versions of the native DLLs (32 and 64 bit), I need to be able to specify the correct dir to copy the native DLL from. I

Copy built assemblies (including PDB, .config and XML comment files) to folder post build

 ̄綄美尐妖づ 提交于 2019-11-28 06:38:14
问题 Is there a generic way I can get a post-build event to copy the built assembly, and any .config and any .xml comments files to a folder (usually solution relative) without having to write a post-build event on each project in a solution? The goal is to have a folder that contains the last successful build of an entire solution. It would be nice to use the same build solution over multiple solutions too, possibly enabling/ disabling certain projects (so don't copy unit tests etc). Thanks,

In Visual Studio 2012 (C#) How to Create Custom Macros available in Post Build

流过昼夜 提交于 2019-11-27 21:23:29
问题 I want to add in a Post-build event commandline in my Visual Studio 2012 C# project. I have a number of projects in my solution and I would like to add to the list of macros available with "Macros>>". How can I achieve this? For instance I have the command line: "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool.exe" sign /f MYPFXFILEPATH /p MYPASSWORD /t http://timestamp.verisign.com/scripts/timstamp.dll $(TargetDir)$(TargetFileName) I would hate to copy and paste that into every

How do I fix MSB3073 error in my post-build event?

…衆ロ難τιáo~ 提交于 2019-11-27 20:06:20
I'm working on a project that requires that DLLs generated by building my solution to be copied from the bin folder to another folder, both of which are on my machine, in my C drive. I've written a batch file that uses xcopy to accomplish this, which you can see here: xcopy /s /y /q "C:\Users\scogan\Documents\Visual Studio 2012\Projects\Organizr\Server\bin\Debug\Organizr.Services.dll" "C:\inetpub\wwwroot\AppServer\bin\" xcopy /s /y /q "C:\Users\scogan\Documents\Visual Studio 2012\Projects\Organizr\Server\bin\Debug\Organizr.Services.pdb" "C:\inetpub\wwwroot\AppServer\bin\" Now, I've tried

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

ε祈祈猫儿з 提交于 2019-11-27 19:06:57
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 added this: <PipelineDependsOn> CustomBeforePublish; $(PipelineDependsOn); </PipelineDependsOn> <