msbuild-task

How to change Assembly Version Number using AssemblyInfoTask?

Deadly 提交于 2019-11-30 13:42:45
问题 I am trying to automate the process for setting the Version for all DLL's, after spending some time I came to know the AssemblyInfo Task with which it can most likely be achieved. So I went ahead and installed it, specifically version 1.0.51130.0 . After Installing, I manually added the Import Tag (by unloading the each project) of AssemblyInfoTask in .cspoj files (the solution has more than 35 proj files). <Import Project="$(MSBuildExtensionsPath)\Microsoft\AssemblyInfoTask\Microsoft

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

夙愿已清 提交于 2019-11-30 08:38:53
问题 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)\$

How to change Assembly Version Number using AssemblyInfoTask?

喜夏-厌秋 提交于 2019-11-30 08:11:59
I am trying to automate the process for setting the Version for all DLL's, after spending some time I came to know the AssemblyInfo Task with which it can most likely be achieved. So I went ahead and installed it, specifically version 1.0.51130.0 . After Installing, I manually added the Import Tag (by unloading the each project) of AssemblyInfoTask in .cspoj files (the solution has more than 35 proj files). <Import Project="$(MSBuildExtensionsPath)\Microsoft\AssemblyInfoTask\Microsoft.VersionNumber.Targets"/> Next I modified the Microsoft.VersionNUmber.Target file which will be installed in

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

≡放荡痞女 提交于 2019-11-30 07:15:59
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't really like (I don't quite understand what I'm doing and I'm obviously doing it wrong). Here's where

MSBuild MSBuildCommunityTasks Task Time

為{幸葍}努か 提交于 2019-11-30 06:42:40
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. In msbuild 4 you can now $([Namespace.Type]::Method(..parameters…)) $([Namespace.Type]::Property) $([Namespace.Type]::set_Property(value)) so I am using $([System.DateTime]::Now.ToString(

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

蹲街弑〆低调 提交于 2019-11-30 05:21:06
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 the image to appear, in PNG format, in my XAP package. Ideally I would like to do this in such a way

How to invoke the same msbuild target twice with different parameters from within msbuild project file itself

不羁的心 提交于 2019-11-30 01:56:22
I have the following piece of msbuild code: <PropertyGroup> <DirA>C:\DirA\</DirA> <DirB>C:\DirB\</DirB> </PropertyGroup> <Target Name="CopyToDirA" Condition="Exists('$(DirA)') AND '@(FilesToCopy)' != ''" Inputs="@(FilesToCopy)" Outputs="@(FilesToCopy -> '$(DirA)%(Filename)%(Extension)')"> <Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(DirA)" /> </Target> <Target Name="CopyToDirB" Condition="Exists('$(DirB)') AND '@(FilesToCopy)' != ''" Inputs="@(FilesToCopy)" Outputs="@(FilesToCopy -> '$(DirB)%(Filename)%(Extension)')"> <Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(DirB)" />

MSBuild and Webpack

守給你的承諾、 提交于 2019-11-30 00:44:45
I am developing an Angular2 application in VS2015 and have a webpack bundling and minification environment set up for the same. This is my webpack.conf.js switch (process.env.NODE_ENV) { case 'prod': case 'production': module.exports = require('./config/webpack.prod'); break; case 'test': case 'testing': //module.exports = require('./config/webpack.test'); break; case 'dev': case 'development': default: module.exports = require('./config/webpack.dev'); } I have also installed a webpack task runner which invokes this with the following commands cmd /c SET NODE_ENV=development&& webpack -d -

MSBuild UsingTask Resolve References

允我心安 提交于 2019-11-30 00:27:11
问题 I feel like I've fixed this before, but I can't remember how. I have a tasks file that looks like this (CustomTasks.tasks): <UsingTask AssemblyFile="CustomTasks.dll" TaskName="MyCustomTask"/> it references an assembly (namely Ionic.Zip.dll). Ionic.Zip.dll is not in the GAC (and I don't want it to be). It sits right next to my CustomTasks.dll. I have a directory called MSBuild one level up from my sln file which has CustomTasks.tasks, CustomTasks.dll and Ionic.Zip.dll in it. I have a csproj

MSBuild, custom task to run custom tool to generate classes for linq to sql model?

▼魔方 西西 提交于 2019-11-29 23:46:31
问题 I have the following scenario. We use stored procedures to access the database and we use LiNQ 2 SQL to generate the classes or namely we use Unplugged LINQ to SQL Generator for this. It has been run as a custom tool but diffing the generated classes is a big pain in the neck. We would like to auto generate the classes but exclude it from version control so I set on the task of creating an msbuild task. Found this post and this post but I can't solve this one by myself. I added some code the