MSBuild
*******
Links
=====
- `MSBuild Reference`_
- `MSBuild Wiki`_
- `Practical .NET2 and C#2: An introduction to MSBuild`_
Plugins
-------
- `MSBuild Extras - Toolkit for .NET 1.1 MSBee`_
Install
=======
I have installed the .NET Framework - SDK, :doc:`../dotnet/sdk`, which installs
a shortcut to an *SDK Command Prompt*. Running ``msbuild`` from this prompt
runs the tool.
Getting Started
===============
A very simple project file:
::
HelloWorldCS
To build this project (which compiles ``consolehwcs1.cs`` into an ``exe``):
::
msbuild
All files
=========
To build all ``cs`` files in the ``src/main/java/`` folder:
::
.\target
Note: The ``cs_source`` array is accessed using the ``@`` symbol and normal
brackets (not curly brackets).
Library
=======
To create a ``dll`` file:
::
Cow
Note, the ``TargetType`` is set to ``library``.
References
==========
To include references:
::
target
Note the ``References = "@(Reference)"`` section in the ``Csc`` task.
When a project like this is loaded into a Microsoft IDE, the references cause
an error like this:
::
Warning 1 The referenced component 'log4net.dll' could not be found.
I can't solve this. I have tried setting the ``HintPath`` and the
``ReferencePath`` but it makes no difference. You can still browse the objects
so I guess it might be ok for now.
.NET 1.1
========
To target .NET 1.1 using MSBuild:
- Install the .NET 1.1 SDK.
- Download *MSBee* (see plugin links above). I installed to:
::
C:\Program Files\MSBuild\MSBee\
This installs a new *Power Toys for Visual Studio* program group. This group
contains a manual for *MSBee*.
.. _`MSBuild Reference`: http://msdn2.microsoft.com/library/0k6kkbsd.aspx
.. _`MSBuild Wiki`: http://channel9.msdn.com/wiki/default.aspx/MSBuild.HomePage
.. _`Practical .NET2 and C#2: An introduction to MSBuild`: http://www.codeproject.com/books/msbuild.asp
.. _`MSBuild Extras - Toolkit for .NET 1.1 MSBee`: http://www.codeplex.com/Wiki/View.aspx?ProjectName=MSBee&title=Home