msbuild

Before and AfterBuild Target in Visual Studio not firing

风流意气都作罢 提交于 2019-12-30 03:50:27
问题 I am doing the following: I have created a default class file project Edited the csproj file to include Pre and Post BuildEvents Uncomment the default commented out BeforeBuild and AfterBuild targets The BeforeBuild and AfterBuild targets are not called form within Visual Studio but are from msbuild command line, why is that? I would rather use msbuild targets rather than the PostBuildEvent as if gives me more power and flexibility, assuming it works. Cheers, adam I shortened some of the

MSBuild Property Scope

╄→尐↘猪︶ㄣ 提交于 2019-12-30 00:52:07
问题 Once again I'm battling MSBuild. I want to have a property value defined with a root path. As part of the build, the path will get updated with version information. However, MSBuild seems to have its own scoping rules that seem completely backwards. Take this first example: <?xml version="1.0" encoding="utf-8"?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <MyPath>\\server\folder</MyPath> </PropertyGroup> <Target Name="Main">

Create a custom powershell script for nuget that adds a custom target to the csproj BeforeBuild step

依然范特西╮ 提交于 2019-12-30 00:42:06
问题 I want to create a nuget package that adds a BeforeBuild step to my csproj using a custom MSBuild task I have created. Ideally, I want to: Add a new Target into the csproj file (MyCustomBeforeBuildTarget) Add the BeforeBuild target if it is not already there Edit the BeforeBuild DependsOnTargets attribute to include my custom target So after install my csproj should have the following in: <Target Name="MyCustomBeforeBuildTarget" Condition="SomeCondition"> <MyCustomTask /> </Target> <Target

Speeding up build times in ASP.NET

独自空忆成欢 提交于 2019-12-30 00:36:14
问题 I am currently involved in a ASP.NET project with about 40 projects in the solution. We are doing all our development in cloned Virtual PC environments so all developers have identical setups. That's all good, managing dependencies is easy, however building the solution is horribly slow. Virtual PC can only utilize one CPU so I'm really only using half of my computers resources. It takes a full 3 minutes from build to a complete page load.. and it's getting worse every day as the projects

How to run MSBuild from Powershell without spawning msbuild.exe process?

谁都会走 提交于 2019-12-30 00:35:33
问题 I am considering running MSBuild from a Powershell script by tapping directly to the MSBuild assemblies (as opposed to looking up MSBuild install path and starting msbuild.exe as a child process). Has anyone done this? What would be the simplest, most straightforward way to run the build? Are there any pros/cons to either technique you'd like to point out? (I'm especially interested in any issues that might arise from running msbuild in the same process/appdomain as the rest of the script).

allowDefinition='MachineToApplication' msbuild error

爷,独闯天下 提交于 2019-12-29 18:20:07
问题 We have a ASP.NET MVC with 4-5 different build configurations. Whenever we change the build configuration, we need to delete the obj folder for the web project, since we get the 'allowDefinition='MachineToApplication' error. A pain, but we managed by deleting the folder in pre/post build events. Now I need to configure our CI to build deployment packages. This means that I cannot delete the obj folder. Every time I compile e.g. with the following msbuild parameters /p:CreatePackageOnPublish

allowDefinition='MachineToApplication' msbuild error

只愿长相守 提交于 2019-12-29 18:19:49
问题 We have a ASP.NET MVC with 4-5 different build configurations. Whenever we change the build configuration, we need to delete the obj folder for the web project, since we get the 'allowDefinition='MachineToApplication' error. A pain, but we managed by deleting the folder in pre/post build events. Now I need to configure our CI to build deployment packages. This means that I cannot delete the obj folder. Every time I compile e.g. with the following msbuild parameters /p:CreatePackageOnPublish

Build Configuration: Mixed Platform VS Any CPU

◇◆丶佛笑我妖孽 提交于 2019-12-29 11:40:26
问题 What's the difference between different Build Configuration settings e.g. Any CPU, Mixed Platform, WIN32 etc in Visual Studio. 回答1: Here's a link that helps explain the build configuration setting found in Visual Studio and its build files: http://web.archive.org/web/20151215192101/http://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/ Basically the setting states what platform the assembly is able to run on. When AnyCPU is selected, the resultant DLL is marked as

How to check all projects in solution for some criteria?

你说的曾经没有我的故事 提交于 2019-12-29 09:15:53
问题 I need to let all projects in solution contain some additional build actions, e.g. StyleCop validation, autogenaration of AssemblyInfo's, etc. My idea is to make some kind of solution-wide prebuild event that will check all project files for containing nodes that match specific xPath. It's not a hard part, it can be solved either with custom build task, or with some third-party Xml handling task. I didn't investigate it deeply yet, but it definitely won't make a problem worth mentioning here.

How to check all projects in solution for some criteria?

社会主义新天地 提交于 2019-12-29 09:15:18
问题 I need to let all projects in solution contain some additional build actions, e.g. StyleCop validation, autogenaration of AssemblyInfo's, etc. My idea is to make some kind of solution-wide prebuild event that will check all project files for containing nodes that match specific xPath. It's not a hard part, it can be solved either with custom build task, or with some third-party Xml handling task. I didn't investigate it deeply yet, but it definitely won't make a problem worth mentioning here.