pre-build-event

Unique Assembly name every build

会有一股神秘感。 提交于 2019-12-23 02:32:59
问题 I’m trying to change the Assembly name of my dll during build. I’ve created another exe that changes the assembly name in the csproj file, which I execute during pre-build. But it seems like my changes to the csproj file only take effect after the build has finished, which is of course not what I want. The assembly name has to be unique every time it gets built, so I create it by appending a GUID. var xmlDoc = XDocument.Load(projectFile); XNamespace ns = "http://schemas.microsoft.com

Swallowing errors in pre-build steps in Visual Studio 2010

戏子无情 提交于 2019-12-17 18:13:19
问题 My solution has a bunch of projects one of which is a windows service; I have a prebuild step to stop the service and a postbuild step to restart it (this way the windows service exe is not locked when VS is building/overwriting it). on pre-build: net stop myservice on post-build: net start myservice If the service is not running while I'm starting the build, the net stop command fails and that prevents the build from proceeding. What can I do to still force the build even if the pre-build

Combine SQL files with command `copy` in a batch file introduce an incorrect syntaxe because it does add an invisible character `U+FEFF`

跟風遠走 提交于 2019-12-13 03:48:34
问题 In a pre-build event, a batch file is executed to combine multiple SQL files into a single one. It is done using this command : COPY %@ProjectDir%\Migrations\*.sql %@ProjectDir%ContinuousDeployment\AllFilesMergedTogether.sql Everything appear to work fine but somehow the result give an incorrect syntaxe error. After two hours of investigation, it turn out the issue is caused by an invisible character that remain invisible even with notepad++. Using an online website, the character has been

iOS Pre-build action to change plist value based on Scheme

不打扰是莪最后的温柔 提交于 2019-12-13 03:48:05
问题 I have an iOS application that is using the Agentry framework to define the Agentry server URL to connect. The agentryServerURL parameter is included in a separate branding.plist file as per the SAP specs. What I am trying to do is tie my iOS schemes for the different environments to a pre-build action in order to change the Agentry URL value. Here is my current script but it is not working. #!/bin/sh plist=$SRCROOT"/branding.plist" if [ ${CONFIGURATION} = "DEV" ]; then /usr/libexec

c# Generate c# code before compilation/buil (Like maven plugin in java)

隐身守侯 提交于 2019-12-12 13:13:51
问题 I have a projet in c# .net. I need to hook the "pre build" event so I can run a c# class that will generate other c# class to the same project. I know that in java you can generate source code using maven plugin, is it possible in .net? Thanks. 回答1: There are at least two options: Use T4 Add a pre-build step to the build file. T4 is the inbuilt way to do code generation (and widely used in ASP.NET MVC scaffolding and Entity Framework type generation). However T4 doesn't directly support

MSBuild BeforeBuild Step

北战南征 提交于 2019-12-10 22:06:23
问题 I asked yesterday about getting AfterBuild working and was able to get that working by placing it at the very bottom of the Project section: MSBuild AfterBuild Step I have tried the exact same thing with a different project. This is my BeforeBuild code: <Target Name="BeforeBuild"> <Message Text="###HI###" Importance="High" /> </Target> I don't have another before Target Name="BeforeBuild" in the project and I have this placed at the very bottom of the Project section. The .vcxproj is parsing

Modify .csproj in pre-build event

核能气质少年 提交于 2019-12-10 19:09:51
问题 tl;dr: How to modify the .csproj file during publishing with ClickOnce while executing pre-build events? Long: I'm using TFS hosted by Microsoft for version control of my solution. When publishing with ClickOnce , I get the latest revision number + 1 without problems. I also can successfully write the new version number into the .csproj file outside my build-process. The problem is, that the .csproj file doesn't get updated during the build process - it might be in a write-lock. I get a

MSBuild: Deploying files that are not included in the project

徘徊边缘 提交于 2019-12-09 17:28:00
问题 I have a Pre-build event on a web project that minifies and concatenates javascript files using node. This creates a folder called BuiltScripts in the scripts folder that is a duplicate of the scripts folder except the files are minified. When I am doing a deploy I want to publish the scripts folder including the BuiltScripts folder within it. To achieve this I have added the BuiltScripts folder to the project. This is not an ideal solution as: I have to have the BuiltScripts folder checked

Alternative to Pre/Post Build Events in Visual Studio

雨燕双飞 提交于 2019-12-07 12:08:59
问题 The Pre/Post Build Events in Visual Studio has bugged me for a few years, but I just haven't got around to research a better alternative. The thing that I want to achieve is pretty much the same as I get with Post Build Events: I call a piece of code that does something before or after a project build. The two things with the Pre/Post Build Events that really bugs me is that (1) the code is separated from my project and compiled into a command line .exe and (2) that every error I get will end

Unique Assembly name every build

匆匆过客 提交于 2019-12-06 21:23:28
I’m trying to change the Assembly name of my dll during build. I’ve created another exe that changes the assembly name in the csproj file, which I execute during pre-build. But it seems like my changes to the csproj file only take effect after the build has finished, which is of course not what I want. The assembly name has to be unique every time it gets built, so I create it by appending a GUID. var xmlDoc = XDocument.Load(projectFile); XNamespace ns = "http://schemas.microsoft.com/developer/msbuild/2003"; string newAssemblyName = originalAssemblyName + "_" + Guid.NewGuid().ToString("N");