post-build-event

How to get version number in post-build event

早过忘川 提交于 2019-12-20 09:58:26
问题 I want to use post-build event to automatically create a nuget package and then copy it to a shared folder on our network, something like this (the version number 1.0.0.0. is specified inside the MyLib.nuspec file): nuget.exe pack "$(SolutionDir)MyLib.nuspec" xcopy /Y "$(TargetDir)MyLib.1.0.0.0.nupkg" \\folder\subfolder\NuGetPackages This works, but now I would like to update this script, so that it would include the assembly version also, but I cannot get assembly version inside the post

Add post build event without overwriting existing events

回眸只為那壹抹淺笑 提交于 2019-12-19 09:52:26
问题 I have a Powershell script (run by my NuGet package) that adds a post build event to a user's Visual Studio project. $project.Properties | where { $_.Name -eq "PostBuildEvent" } | foreach { $_.Value = "xcopy `"`$(ProjectDir)MyFolder`" `"`$(OutDir)`"" } Unfortunately it currently overwrites the existing post build event. How can I modify the Powershell script to append my build event if it does not already exist? I've never used Powershell before but I tried simply appending it inside the

Can Visual Studio automatically adjust the name of other file as it does with app.config?

不羁岁月 提交于 2019-12-19 02:05:48
问题 When adding an Application Configuration file to a .Net project in Visual Studio it will be named app.config and will be renamed (on build) to ApplicationName.config . I have a solution with about 40 projects. I want to add log4net functionality to quite a few of them. So for every project I would add a file app.log4net . I would then declare a post-build event like this: copy $(ProjectDir)app.log4net $(TargetPath).log4net That works just fine. But I was wondering whether there was a built-in

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

本秂侑毒 提交于 2019-12-18 07:35:56
问题 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? 回答1: 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

Copy target file to another location in a post build step in CMake

北战南征 提交于 2019-12-17 15:28:54
问题 I have a dynamic library that gets a different name depending on configuration, specified in the CMake scripts by: set_target_properties(${name} PROPERTIES OUTPUT_NAME ${outputName}64) set_target_properties(${name} PROPERTIES DEBUG_OUTPUT_NAME ${outputName}64_d) The end result is that I get a different name on release and debug builds. I would like to copy the resulting library to a different directory as a post-build step, but the gift(?) of CMake-Fu did not smile upon yours truly. I have

How can I retrieve major/minor/build/revision number on build events

南笙酒味 提交于 2019-12-13 04:58:21
问题 Hy there! I'm using this piece of code, to copy some files on post-build-event: <PropertyGroup> <DemoPath1>..\demoPath1</DemoPath1> </PropertyGroup> <Target Name="AfterBuild"> <Exec Command="robocopy $(ProjectDir)$(DemoPath1) $(ProjectDir)demoPath2/$(Revision) * /XD .svn _svn /XF *.cs /S" IgnoreExitCode="true" /> </Target> As you can see, I would like to use $(Revision) - obviously, this is not going to work ... Can anybody help me out? @mods: I dunno exactly which tag to use ... on the one

Add Jenkins Groovy Postbuild step to all jobs

拜拜、爱过 提交于 2019-12-13 01:50:03
问题 How can the same Jenkins Groovy Postbuild Plugin step be added to all jobs? We have 50+ jobs, so it is too hard to copy-paste the link to desired groovy code to every job. 回答1: I usually do similar mass changes by updating the config.xml of the effected jobs. Every good editoru should have a search and replace function that works on files. use the following workflow. shut down Jenkins update job config.xml files start up Jenkins There are other possible workflows like the following 1. update

Tfs post-build step running application hangs

六眼飞鱼酱① 提交于 2019-12-12 05:06:16
问题 We have a configured TFS CI which is making our build. After a build I`d like to have my simple executable application to be deployed to specific folder on the server and then started. I decided to do this with post-build step and batch script. Everything works perfectly except one: when the application is stared, build agent(the one who runs my script) hangs. Here is how I start my application from the script: start /b %depldir%\MyApp.exe [params] > log.txt So I start it in backgroound and

why does my post-build xcopy always copy the previous version (or hang)?

感情迁移 提交于 2019-12-11 16:48:23
问题 I have a solution which creates DLLs and a post-build xcopy that copies them to a target folder where another solution consumes them. I have noticed that all seems to be well but in fact the xcopy always copies the previous version instead of the freshly built one. This is Case A . Even weirder (but possibly related): when I switched to a batch file to do the xcopy the build hangs. ( B ) And, finally, if I use a simple copy command in the batch file the build is successful, but again, the

UnicodeEncodeError with Visual Studio Post-Build Command Line

六眼飞鱼酱① 提交于 2019-12-11 16:06:30
问题 I am trying to run a Python script from a Visual Studio C/C++ project's Post-Build Command Line. The arguments for the script contain German Umlauts, let's say Ü . The Command Line Script is python "<path to python .py>" Ü The Python script simply prints the first (second) argument back to the Command Line: import sys if __name__ == "__main__": print(sys.argv[1]) However, this raises an exception for the last line: ... File "C:\Python36\lib\encoding\cp1252.py", line 19, in encode return