Questions tagged [build-events]

61 questions
20
votes
4 answers

Visual Studio Linked Files don't exist

In Visual Studio, you can do Add -> Existing Item and then Add as Link from the Add drop down button. This is great. This let's you add a file from another project, and editing the file also edits it in the original project. I would like to use this…
nl-x
  • 11,762
  • 7
  • 33
  • 61
17
votes
3 answers

Configure NuGet package to add a build event when installed

Does anyone know if it's possible to add something to a nuspec file so that when a package is installed via NuGet a pre or post build event to a project?
Trevor Pilley
  • 16,156
  • 5
  • 44
  • 60
12
votes
3 answers

Is it possible to use conditional compilation symbols in VS build events?

Say for instance I have a Visual Studio project with a configuration called "MyConfig" and I have the compilation symbol MY_CONFIG_SYMBOL defined. Is there a macro or command to see if MY_CONFIG_SYMBOL is defined in the pre/post build events?…
Mike Webb
  • 8,855
  • 18
  • 78
  • 111
9
votes
1 answer

running dotnet publish in post build event in asp.net core

I want to publish my web site after building.Is there any way to run dotnet publish command in post build event in asp,net core? This is my project.json file: { "dependencies": { "Microsoft.NETCore.App": { "version": "1.0.0", …
user1968030
7
votes
1 answer

Output errors, warnings and messages from batch file in Visual Studio build event

I'm writing a batch file to be executed from a pre-build event in Visual Studio. How can I make it output errors, warnings and messages to the Visual Studio Error List? It's very hard to search for this as most things that come up are how to fix…
dav_i
  • 27,509
  • 17
  • 104
  • 136
7
votes
1 answer

Visual Studio 2008 Post Build event -- only run on Rebuild

In Visual Studio 2008 we run a post build event which calls NANT and in turn creates our config files. e.g. if $(SolutionDir) == . GOTO end nant -buildfile:$(SolutionDir)default.build create..web.config Is there a way to run this only on ReBuild?
Chris McKelt
  • 1,378
  • 2
  • 17
  • 38
6
votes
0 answers

How to reload project in VS with Target command before build

I am looking for a way to Reload a project OR all projects inside the Solution, with Target node , which is in pre-build events node of .csproj file ...
6
votes
1 answer

Call a method from a build event

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…
Mefhisto1
  • 2,188
  • 7
  • 34
  • 73
5
votes
2 answers

How to suppress initial post-build event error in Visual Studio 2017 (C#)?

I have a C# solution in Visual Studio 2017. I also have a batch script called foobar.bat that contains the following code: echo foobar : error 1: This is a test error. My goal is to get only the test error message above to appear in…
5
votes
2 answers

GAC installation on every build - how to do it reliably

I would like to reliably auto-install my application assemblies in the GAC when I compile my application using Visual Studio. I've setup pre- and post-build events in my web application's build. Pre build event: "C:\Program Files (x86)\Microsoft…
Robert Koritnik
  • 103,639
  • 52
  • 277
  • 404
5
votes
1 answer

Use Visual Studio macros in powershell scripts called from build event

I want to use a powershell script in a build event in Visual Studio, and I need to use some macro defined in Visual Studio itself. This is my powershell script sample: "Updating version for Project:" "$ProjectDir" Then in pre-build event of the…
Jepessen
  • 11,744
  • 14
  • 82
  • 149
4
votes
2 answers

How to emulate /p msbuild parameter in Visual Studio build?

That the logical follow-up for the my previous question: "How to check all projects in solution for some criteria?" I was given quite a good answer to use CustomAfterMicrosoftCommonTargets, CustomBeforeMicrosoftCommonTargets. They do work, so I…
Andriy K
  • 3,302
  • 31
  • 42
4
votes
2 answers

Execute exe file or bat file after compile with Visual Studio 2010

I would execute an exe file or a bat file after that the compilation of a C++ program ends. How could I do this? EDIT 1 This is my actual command line: start "C:\mypath\myexe.exe myarguments"
Stefano
  • 3,213
  • 9
  • 60
  • 101
4
votes
2 answers

How can I write a registry key from VS post build event?

One of the projects I work on need to read a registry key in order to determine some value. Usually the value will be written during installation. Because I want to run the project locally as well (without installation) I want to write that value…
Dror Helper
  • 30,292
  • 15
  • 80
  • 129
3
votes
0 answers

gitab webhooks:when "Build events"was triggered,what type about json will be send?

I want to write a webapi using .net to receive json that gitlab webhooks send when "Build Events" was triggered. I want to write a data model at .net that is same as json type. But I do not know the json type that was sent. Could anyone tell me…
1
2 3 4 5