build-events

Visual studio to override file on selected build configuration

泄露秘密 提交于 2020-04-30 07:17:29
问题 at the moment my project has a license file. No extension attached to the file. The file itself only contains a key. I have 3 build configuration Dev Stage Prod At the moment I have 4 license file. GLicense GLicense_dev GLicense_stage GLicense_prod I tried to use #c preprocessor directive but the third party dll requires me to have the license name exactly as GLicense . The next approach I was thinking of taking was overriding the content of GLicense when building. I was wondering how abouts

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

你说的曾经没有我的故事 提交于 2020-01-13 10:08:10
问题 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", "type": "platform" }, "Microsoft.AspNetCore.Mvc": "1.0.0", "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", "Microsoft.Extensions.Configuration

Execute bat file in the build event got the error “error MSB3073: The command ”call “MyTest.bat” exited with code 1."

不羁岁月 提交于 2020-01-06 05:34:30
问题 In our solution we have more than 150 projects, I need build one of project before others, but I did not want to set project reference or project dependencies for more than 100 projects one by one. This is a waste of time. So I ask following question before this one: Set build order without using project reference And as @Leo Liu suggested that I could use batch file to build the project first, it is should be a valid workaround. As optimization, I want set this bat file in the build event of

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

Visual Studio Linked Files don't exist

你。 提交于 2019-12-18 03:54:59
问题 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 feature to have a config file (named Shared.config) be present in all projects within one solution. And have that file always be the same. solution | |- project 1 | - Shared.config [physical] |- project 2 | - Shared.config [linked] After

Configure NuGet package to add a build event when installed

倾然丶 夕夏残阳落幕 提交于 2019-12-17 19:33:23
问题 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? 回答1: I think editing the user's PostBuildEvent property is the wrong way to go about adding a post-build action to a project. I believe the recommended way is to put your custom action into an MSBuild Target that is imported into the project file. As of NuGet 2.5, if you include a 'build' folder in your package (at the same level as content

Visual Studio 2008 Post Build event — only run on Rebuild

余生颓废 提交于 2019-12-06 02:04:33
问题 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? 回答1: I think you can do this by specifying build targets rather than using build events. Try creating an AfterClean target to delete your generated config files, and a BeforeBuild target to create them. Make sure you set up the file dependency for

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

给你一囗甜甜゛ 提交于 2019-12-05 08:55:06
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", "type": "platform" }, "Microsoft.AspNetCore.Mvc": "1.0.0", "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0", "Microsoft.Extensions.Configuration.Json": "1.0.0", "Microsoft.Extensions.Logging"

Visual Studio 2008 Post Build event — only run on Rebuild

老子叫甜甜 提交于 2019-12-04 06:25:57
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? I think you can do this by specifying build targets rather than using build events. Try creating an AfterClean target to delete your generated config files, and a BeforeBuild target to create them. Make sure you set up the file dependency for the BeforeBuild target, so msbuild knows it should only run the step if the file isn't present. I haven't

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

巧了我就是萌 提交于 2019-12-01 06:33:44
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 decided not to stop in the middle. Issue is that I don't want machine-wide tasks. It's not a good idea neither for me (it will affect other builds. sure, this can be handled, but still), nor for my teammates (I don't want to let them put something in system folders... ), nor for build server. What is needed: solution to be built from scratch out of