msbuild-task

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

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="$(BuildDefi...

Test driven development of an MSBuild Task

What approach would you take while developing a custom MSBuild Task in a test driven way? Are there any available test harnesses suitable for test drive development of a Microsoft.Build.Utilities.ToolTask extension? I was considering attempting to use NUnit or MSUnit and check files generated and where they are placed, though this I ...

Wrong version of aspnetcompiler when using msbuild 4.0

I'm trying to use the AspNetCompiler task within a custom msbuild file to precompile an asp .net 4.0 website. However, when i run: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe custom.msbuild /t:PrecompileWeb it uses the v2.0.50727 aspnet_compiler. Is there a way to force it to use the v4.0.30319 aspnet_compiler? The reas...

error MSB4006: There is a circular dependency in the target dependency graph involving target "Install".

I'm use msbuild for deploy my applications, using VS 2008, windows xp It appears this errors: warning MSB4011: There is a circular reference involving the import of file. error MSB4006: There is a circular dependency in the target dependency graph involving target "Install". ScriptDespliegue.Targets file call to task from $(MSBuild...

Visual Studio 2008 locks custom MSBuild Task assemblies

I'm developing a custom MSBuild task that builds an ORM layer, and using it in a project. I'm being hampered by Visual Studio's behaviour of holding onto MSBuild task DLLs and not letting go. I'd like to organize my solution like this; My Solution | +- (1) ORM Layer Custom Task Project | | | +- BuildOrmLayerTask.cs // here's...

MSBuild task to get update FileAssemblyVersion for only projects with changes.

Is there any way, using msbuild or otherwise, to detect which projects have changes in the current build and update the FileAssemblyVersion attribute in AssemblyInfo.cs for those projects only? ...

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

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 ...

ASP.NET 4 web.config transformation MSBUILD

Hi, I want to use the newly introduced web.config transformation options in VS2010. But I'm not using the Deploy option of VS2010, i'm using Web Deployment Projects with MSBUILD tasks. Can I apply the transformation with an MSBUILD task? ...

add items to visual studio solution in msbuild task

I have created a msbuild task that minifies and combines javascript and css files that is triggered when my visual studio project is built. This task adds the minified and combined files to the file system. However I would like that they automatically be added into the visual studio project. Is this possible and if so, how can I achiev...

SvnCommit (MSBuild context) misses one file from the ItemGroup

I'm using MSBuild with the community tasks under TeamCity. Just like Garrett in this thread, I update my AssemblyInfo.cs files, and then commit them. In the solution at hand, I've got five AssemblyInfo.cs files, but only four get committed using this MSBuild code: <Target Name="VersionCommit" DependsOnTargets="Version"> <ItemGroup...

need mbsuild task to combine app.config files

does anyone know of a solution here? Combine select app.config files into one app.exe.config file. ...

Can I call a MSBuild Task from Mono XBuild?

Can I call a MSBuild Task from Mono XBuild? http://msdn.microsoft.com/en-us/library/ms126274.aspx http://www.mono-project.com/Microsoft.Build ...

DEP - trying to make executables NON-DEP Compliant using msbuild and Team Build Project

I am attempting to resolve a DEP issue by running editbin.exe /NXCOMPAT:NO in a TFS Team build project (instead of just the post build event). Primarily because we have to put the executable into an .msi for deployment. Here is the code that I am using in the target: $(VS90COMNTOOLS)....\VC\bin\editbin.exe $(Solutio...

Using MSBuild task for ftp a directory in TFS 2010

Hi all, Is there any tutorial to show how can I use MSBuild tasks like FtpUploadDirectoryContent to copy file/directory to a remote host using FTP in Team Build 2010? I never used a MSBuild task in TFS 2010. ...

Moving a file in MSBuild using relative path

I'm trying to move all files of a certain type to a directory relative to the file itself and I'm wondering if it's possible using MSBuild. Basically, I'm using the Microsoft AJAX Minifier to minify all Javascript and CSS files on my site. This outputs .min.js and .min.css files into the same directory as the Javascript and CSS files. ...

Does possibility to specify enabled protocols for web-application in IIS exist in MSBuild?

I create webdirectory in IIS, using MSBuild task: <WebDirectoryCreate VirtualDirectoryName="$(VirtualDirectoryName)" VirtualDirectoryPhysicalPath="$(VirtualDirectoryPath)" AccessExecute="true"/> Now I look for possibility to specify enabled protocols (http, https, net.tcp) for this webdirectory using MSBuild. Any suggestion? ...

Is there an MSBuild task that will write lines to the *start* of a file?

I'm using a WriteLinesToFile to update a change log file (txt). It appends the text to the end of the file. Ideally, I'd like to be able to write the changes to the start of this file. Is there a simple task (e.g. in the Community or Extension packs) that does this? ...

MsBuild does not look in the good directory for custom task's second-level dependencies

I wrote a MsBuild Task : MyTask. In my solution, I have the Task project and others projects. MyTask references a project (say ProjA) which references third assemblies, say (dep1 and dep2). The projects all builds well and I have the outputs in one directory (Compil). In this directory i have all the dll's I want : MyTask.dll, ProjA.dll...

How can I use MSBuild Copy Task to Copy To Multiple Destination Folders?

I'm trying to copy a folder recursively to multiple destination folders using MSBuild's Copy task. I've seen the following question which gave me a good start, but I must be missing something: http://stackoverflow.com/questions/924972/msbuild-copy-to-several-locations-based-on-list-of-destination-parameter A snippet from my build file...

How can I filter which files are included in a workspace using MSBuild?

It seems that MsBuild creates a folder called, "BuildType" on the build server and this folder is where the .proj file is copied. In source control I have several files that are in the same folder as the build project file. I have a workspace mapped to this location. I would like to be able to specify explicitly which files from this wo...