msbuild-task

MSBuild 2010 - how to publish web app to a specific location (nant)?

▼魔方 西西 提交于 2019-11-29 23:10:50
I'm trying to get MSBuild 2010 to publish a web app to a specific location. I can get it to publish the deployment package to a particular path, but the deployment package then adds its own path that changes. For example: if I tell it to publish to C:\dev\build\Output\Debug then the actual web files end up at C:\dev\build\Output\Debug\Archive\Content\C_C\code\app\Source\ControllersViews\obj\Debug\Package\PackageTmp And the C_C part of the path changes (not sure how it chooses this part of the path). This means I can't just script a copy from the publish location. I'm using this nant/msbuild

MSBuild Task syntax for deleting files

爷,独闯天下 提交于 2019-11-29 21:17:30
I'm trying to write a MSBuild Task that deletes the Obj directory and PDBs from my bin folder on my production build scripts and can't seem to get it to work right. Does anyone have an example where they do this or similar, or a link to a simple example of removing files and a directory with MSBuild? If you're looking to delete an entire directory you require the RemoveDir task: <RemoveDir Directories="Path/To/Obj" /> And if you're wanting to delete the PDB files from bin you'll want the Delete task: <Delete Files="Path/To/Bin/MyApp.pdb" /> Note that you cannot use wildcards in the Delete task

How call Web Essentials task in MSBuild ?

 ̄綄美尐妖づ 提交于 2019-11-29 15:37:09
Web essentials works great when build in VS, but seems no way to build/bundle (Scss/js,Html,Sprit) when call MSBuild (like team city). I googled lot stuffs, but only find - https://www.nuget.org/packages/Pta.Build.WebEssentialsBundleTask/ but it only support bundle, is there any other way to do that ? finally, I found http://madskristensen.net/ , Mads Kristensen split Bundler & Minifier and Web Compiler from Web Essentials 2015, and it supported integrate with MSBuild process !!!! https://visualstudiogallery.msdn.microsoft.com/9ec27da7-e24b-4d56-8064-fd7e88ac1c40 https://visualstudiogallery

Determining outputs of a ProjectReference in MSBuild without triggering redundant rebuilds

大兔子大兔子 提交于 2019-11-29 10:23:16
As part of a solution containing many projects, I have a project that references (via a <ProjectReference> three other projects in the solution, plus some others). In the AfterBuild , I need to copy the outputs of 3 specific dependent projects to another location. Via various SO answers, etc. the way I settled on to accomplish that was: <MSBuild Projects="@(ProjectReference)" Targets="Build" BuildInParallel="true" Condition="'%(Name)'=='ProjectA' OR '%(Name)'=='ProjectB' OR '%(Name)'=='ProjectC'"> <Output TaskParameter="TargetOutputs" ItemName="DependentAssemblies" /> </MSBuild> <Copy

How do I get an msbuild task to do config transforms on a collection of files?

泪湿孤枕 提交于 2019-11-29 09:27:09
问题 I am trying to transform all of the web.config files in a project I have, here's a my tree structure: Transform.bat Transforms ConfigTransform.proj Web.Transform.config Website web.config Views web.config There's more web.config files, but the idea is that this will find all of them and apply the same config transform on them. I've taken a few hints from a blog post I found but I get stuck in the last step, the actual transformation. Also there's a bit of a rough part in the middle that I don

“File has a different computed hash than specified in manifest” error when signing the EXE

旧城冷巷雨未停 提交于 2019-11-29 07:27:57
My ClickOnce installation fails with an error: File, WindowsFormsProject.exe, has a different computed hash than specified in manifest. I use MSBuild to generate ClickOnce deployment package. The relevant line from the build script: <MSBuild Targets="Publish" Projects="WindowsFormsProject.csproj" ContinueOnError="false" /> The WindowsFormsProject.csproj has a Post-Build step that signs the executable, as follows: signtool sign /a $(ProjectDir)\obj\$(PlatformName)\$(ConfigurationName)\$(TargetFileName) The trouble is, when I look at the build log I see that the manifest is generated BEFORE the

MSBuild copy output from another project into the output of the current project

早过忘川 提交于 2019-11-29 07:25:15
I have a situation where I want to copy the output assembly from one project into the output directory of my target application using MSBuild, without hard-coding paths in my MSBuild Copy task. Here's the scenario: Project A - Web Application Project Project B - Dal Interface Project Project C - Dal Implementation Project There is a Business layer too, but has no relevance for the MSBuild problem I'm looking to solve. My business layer has a reference to my Dal.Interface project. My web project has a reference to the Business layer and as it stands, doing a build will pull the business layer

MSBuild MSBuildCommunityTasks Task Time

£可爱£侵袭症+ 提交于 2019-11-29 06:24:21
问题 I have a MSBuild project and I want the current date to be added to a zip file that I am creating. I am using the MSBuildCommunityTasks. <!-- Import the CommunityTasks Helpper --> <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" /> On the website http://msbuildtasks.tigris.org/ I can see a task called time. I have not been able to find doc on how to use Time. 回答1: In msbuild 4 you can now $([Namespace.Type]::Method(..parameters…)) $([Namespace

MSBuild: How do I create and use a Task to convert Content items at build time?

泪湿孤枕 提交于 2019-11-29 04:49:41
问题 I have a Silverlight 3 project with something like this: <ItemGroup> <Content Include="Content\image1.png"> </Content> </ItemGroup> Basically I've added a PNG file to my project and set its build action to "Content". This works nicely. Now what I'd like to do is be able to add images in a different format to my project, and have them converted to PNG at build time - so that the end result is as if I had added a PNG image to the project (as Content) in the first place. In other words - I want

Is there any MSbuild task to check if a string contains another string (similar to string.contains)

烈酒焚心 提交于 2019-11-29 02:49:15
I have this Msbuild code: <Import Project="A.proj" Condition="$(BuildDefinition) =='Dist Staging to Dev' Or $(BuildDefinition) =='Dist Staging to Dev(Services Only)'"/> But I was wondering if is there anything similar to check if an string contains some text to get something similar to: <Import Project="A.proj" Condition="$(BuildDefinition) CONTAINS 'Dist Staging to Dev'"/> Julien Hoarau If you use MSBuild 4, you could use Property function <Import Project="A.proj" Condition="$(BuildDefinition.Contains('Dist Staging to Dev'))"/> ( More info on Property function ) MSBuild4: As Julien said, in