Hungry Mind , Blog about everything in IT - C#, Java, C++, .NET, Windows, WinAPI, ...

Как создать Task в MSBuild

  • Создать Class Library проект, к примеру MyMSBuildTasks;
  • Добавить Assembly Reference на Microsoft.Build.Framework;
  • Создать public class MyTask, который наследует и реализует интерфейс Microsoft.Build.Framework.ITask;
  • Реализовать метод public override bool Execute(), вернуть true в случае успеха;
  • Подключить его в проект MSBuild следующим образом: <UsingTask TaskName="MyMSBuildTasks.MyTask" AssemblyFile="...\MyMSBuildTasks.dll"/>
  • Пользоваться: <MyTask MyParameter="Something here">...</MyTask>
Для того, чтобы передать в Task параметр, необходимо создать public property: public String MyParameter { get { ... } set { ... } } <MyTask MyParameter="Something here">...</MyTask> Для указания, что параметр является обязательным, - можно пометить атрибутом [Required]: [Required] public String MyParameter { get { ... } set { ... } } Результат работы Task-а можно "отдать" в виде Output-переменных, пометив нужные свойства атрибутом [Output]: [Output] public String MyOutParameter { get { ... } set { ... } }
<MyTask MyParameter="Something here"> <Output TaskParameter="MyOutParameter" ItemName="MyItem"/> </MyTask> <Message Text="MyTask returned $(MyItem) to me!"/> Для упрощения жизни с MSBuild существует сборка Microsoft.Build.Utilities, в которой существуют простейшие реализации классов Task, TaskItem и пр.

10 коммент.:

Анонимный комментирует...

This could necessarily mean that when you have one pair, you could lower and transform your pounds load if you'd like to match your amount of physical fitness or maybe to match up with all the region of one's physique you want
to work out.

My blog post adjustable dumbbell set

Анонимный комментирует...

A broad team of folks want this established to begin with and when they carry on to mature and develop and discover that fifty two.


My webpage - Recommended Website

Анонимный комментирует...

And fortunately for us, there are actually presents for sports activities enthusiasts to meet each spending
budget.

Here is my web page Report abuse

Анонимный комментирует...

If we just take this 2nd notion significantly, then where by will we area pilates?



my blog - dumbbells for sale

Анонимный комментирует...

As with everything else you must keep committed to your exercise routine system irrespective
of in case you are working with weights or resistance bands.


Here is my homepage - http://www.getfitnstrong.com/bowflex-dumbbells/bowflex-selecttech-dumbbells-ultimate-home-exercising/

Анонимный комментирует...

Your elbow ought to then be bent along with the body weight
lowered to help make the elbow assume a right angle.


Here is my page: adjustable weights

Анонимный комментирует...

For a lot of men and women, teaching and dealing out in the home
is the greatest solution that matches in with all aspects of our
fast paced life.

Also visit my homepage: www.getfitnstrong.com

Анонимный комментирует...

The incomparable functionalities of BowFlex TreadClimber generate a broader variety of muscle
groups inside the physique in movement that could eventually increase metabolic
rate.

my site ... best adjustable weight dumbbells

Анонимный комментирует...

This course also lends by itself into a bit much more selection than Human body Pump, because it generally adds the use of tubing, balls, and hand weights.


my blog :: best adjustable dumbbells

Анонимный комментирует...

Overhead Dumbbell Extensions - One among the extra comfortable of workouts for triceps, the extension works from a staring placement that
sees the dumbbells in fingers that are extended in excess of your head.



Have a look at my web blog ... bowflex weights

Отправить комментарий

Copyright 2007-2011 Chabster