3

I can't seem to find how to create an MSBuild script from within Visual Studio. Anyone know how? I'm using VS Professional.

5 Answers 5

7

Start with this as a skeleton for your file,

<?xml version="1.0" encoding="utf-8"?>
<Project
   xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
   ToolsVersion="4.0"
   DefaultTargets="Build">

   <Target Name="Build">
      <Message Text="Building..." />
   </Target>

</Project>
Sign up to request clarification or add additional context in comments.

Comments

3

Make sure the file extension is .msbuild and not .xml this will enable the intellisense.

1 Comment

To be accurate, adding the xmlns="schemas.microsoft.com/developer/msbuild/2003" to the project node is what enables intellisense
2

I don't have any trouble (VS 2010 Premium). A standard MSBUILD file is an XML file, so opening it using File -> Open -> File should open it in the XML editor in VS. Then you can edit, add it to a project or whatever as you need.

I'm not sure if you need a certain edition for the Intellisense to work.

1 Comment

There is no standard template for target files or build files. So you need to create a standard XML file.
2

You can also use this awesome tool: http://www.attrice.info/msbuild/

Comments

1

MSBuild itself is pretty straightforward so it is pretty simple to do it in any text/xml editor.

BTW, MSDN Walkthrough: Creating an MSBuild Project File from Scratch does not tell anything about Visual Studio and just provides tips how-to write script in editor.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.