MsBuild

S

shapper

Hello,

I am working on an ASP.MET MVC Web Application with NET 3.5 in VS
2008.

I need to run some extra tasks on this project build so I download
MSBuild from http://msbuildtasks.tigris.org/.

I installed it but no new project type shows in my VS 2008.

I then found the following template:
http://blogs.conchango.com/stuartpreston/archive/2008/03/21/msbuild-p...

I am not sure if this is the right one ...

However, I don't know how to use it:

1. I don't know how to say to my "Build" project that the target
project is my MVC application

2. I am not sure how can I get the original XML file that builds my
MVC application.
I know that to add my extra tasks I should use this file ... I
think.

Anyway, could someone, please, help me out in making this work?

Thank You,
Miguel
 
S

sloan

I have 2 files.

MSBuildit.bat

and

exclude.txt


Here are the contents:


MSBuildit.bat --<<do not include this line in the bat
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe" MySolution.sln
/p:Configuration=Release
XCOPY .\PresentationDirectoryHere\bin\Release\*.*
c:\wutemp\ReleaseBuild_MySolution /EXCLUDE:.\exclude.txt /e/s
End MSBuildit.bat --<<do not include this line in the bat


exclude.txt--<<do not include this line in the txt file
..pdb
MSBuildit.bat
exclude.txt
..sln
..vbproj
..csproj
..scc
..vssscc
..config
End exclude.txt--<<do not include this line in the txt file

That's one method. There are others.

Mine copies files to a temp directory, but with the exclude file, I filter
out the junk I don't want.
You might want to delete the .config (in the exclude .txt)

I put both files in the directory where MySolution.sln is.


...................

If you are asked about "Is this a file or directory", answer the questions.
Its the XCOPY working.
 
S

shapper

I have 2 files.

MSBuildit.bat

and

exclude.txt

Here are the contents:

MSBuildit.bat --<<do not include this line in the bat
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe" MySolution.sln
/p:Configuration=Release
XCOPY .\PresentationDirectoryHere\bin\Release\*.*
c:\wutemp\ReleaseBuild_MySolution /EXCLUDE:.\exclude.txt /e/s
End MSBuildit.bat --<<do not include this line in the bat

exclude.txt--<<do not include this line in the txt file
.pdb
MSBuildit.bat
exclude.txt
.sln
.vbproj
.csproj
.scc
.vssscc
.config
End exclude.txt--<<do not include this line in the txt file

That's one method.  There are others.

Mine copies files to a temp directory, but with the exclude file, I filter
out the junk I don't want.
You might want to delete the .config (in the exclude .txt)

I put both files in the directory where MySolution.sln is.

..................

If you are asked about "Is this a file or directory", answer the questions.
Its the XCOPY working.

That's to simply or not? I was looking to use MsBuild Tasks (http://
msbuildtasks.tigris.org/)

I also have 2 custom tasks that I need to apply so I think I need to
create a XML file with all the details of the compilation ...

I downloaded MSBuildTasks and the template that I mentioned but I
still have the mentioned problems.

I can't just exclude some directories ... I need to merge files, run
custom tasks, exclude files and directories, etc

Thanks,
Miguel
 
S

sloan

I'm not sure.
This seems like a really good tutorial site:
http://brennan.offwhite.net/blog/2006/11/30/7-steps-to-msbuild/


I have 2 files.

MSBuildit.bat

and

exclude.txt

Here are the contents:

MSBuildit.bat --<<do not include this line in the bat
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe" MySolution.sln
/p:Configuration=Release
XCOPY .\PresentationDirectoryHere\bin\Release\*.*
c:\wutemp\ReleaseBuild_MySolution /EXCLUDE:.\exclude.txt /e/s
End MSBuildit.bat --<<do not include this line in the bat

exclude.txt--<<do not include this line in the txt file
.pdb
MSBuildit.bat
exclude.txt
.sln
.vbproj
.csproj
.scc
.vssscc
.config
End exclude.txt--<<do not include this line in the txt file

That's one method. There are others.

Mine copies files to a temp directory, but with the exclude file, I filter
out the junk I don't want.
You might want to delete the .config (in the exclude .txt)

I put both files in the directory where MySolution.sln is.

..................

If you are asked about "Is this a file or directory", answer the
questions.
Its the XCOPY working.

That's to simply or not? I was looking to use MsBuild Tasks (http://
msbuildtasks.tigris.org/)

I also have 2 custom tasks that I need to apply so I think I need to
create a XML file with all the details of the compilation ...

I downloaded MSBuildTasks and the template that I mentioned but I
still have the mentioned problems.

I can't just exclude some directories ... I need to merge files, run
custom tasks, exclude files and directories, etc

Thanks,
Miguel
 
S

shapper

I'm not sure.
This seems like a really good tutorial site:http://brennan.offwhite.net/blog/2006/11/30/7-steps-to-msbuild/










That's to simply or not? I was looking to use MsBuild Tasks (http://
msbuildtasks.tigris.org/)

I also have 2 custom tasks that I need to apply so I think I need to
create a XML file with all the details of the compilation ...

I downloaded MSBuildTasks and the template that I mentioned but I
still have the mentioned problems.

I can't just exclude some directories ... I need to merge files, run
custom tasks, exclude files and directories, etc

Thanks,
Miguel

I am trying to use this template ... it seems interesting. You create
a project in your solution where you define all the properties of the
build.

Then you just run it and it runs msbuild ...

Do you know how to reference in the XML file the path of the project
to be compiled?

And, a question a side, does anyone knows how to make the command
prompt in windows xp to not close after being used?!
I am trying to see what is being done but the command prompt window
closes to fast!

Thanks,
Miguel
 
S

sloan

Go to Start Run
And then type in "cmd". Hit enter. You get a DOS window.
THen navigate and run the .bat manually.

That'll stop the "disappearing screen" as you try to debug the bat file.


I'm not sure.
This seems like a really good tutorial
site:http://brennan.offwhite.net/blog/2006/11/30/7-steps-to-msbuild/










That's to simply or not? I was looking to use MsBuild Tasks (http://
msbuildtasks.tigris.org/)

I also have 2 custom tasks that I need to apply so I think I need to
create a XML file with all the details of the compilation ...

I downloaded MSBuildTasks and the template that I mentioned but I
still have the mentioned problems.

I can't just exclude some directories ... I need to merge files, run
custom tasks, exclude files and directories, etc

Thanks,
Miguel

I am trying to use this template ... it seems interesting. You create
a project in your solution where you define all the properties of the
build.

Then you just run it and it runs msbuild ...

Do you know how to reference in the XML file the path of the project
to be compiled?

And, a question a side, does anyone knows how to make the command
prompt in windows xp to not close after being used?!
I am trying to see what is being done but the command prompt window
closes to fast!

Thanks,
Miguel
 
S

shapper

I am trying to use this template ... it seems interesting. You create
a project in your solution where you define all the properties of the
build.

Then you just run it and it runs msbuild ...

Do you know how to reference in the XML file the path of the project
to be compiled?

And, a question a side, does anyone knows how to make the command
prompt in windows xp to not close after being used?!
I am trying to see what is being done but the command prompt window
closes to fast!

Thanks,
Miguel

Hello,

Does anyone knows how to indicate which project to be build by
MSBuild?

I have the following:

Build
|-----Build.proj
MyProject

Build is a project that when I run it in VS it calls MSBuild using
Build.proj as build information.

Build.proj is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets="All">
<Import Project="..\properties\build.properties" />
<Import Project="$(MSBuildProjectDirectory)\properties
\build.properties" />
<PropertyGroup>
<BuildPath Condition="'$(BuildPath)'==''">..\Website
\Website.csproj</BuildPath>
<TasksPath Condition="'$(TasksPath)'==''">$(BuildPath)\Bin\Debug</
TasksPath>
</PropertyGroup>
<Target Name="All" DependsOnTargets="Build" />
<!-- add custom targets below -->
<Target Name="Build">
</Target>
</Project>

In this moment it is builing Build itself. I know that I need to
change something so that Build starts to call MSBuild to build
MyProject but I don't know what.

I tried everything I could think of but until now I wasn't able to
make this work.

Thanks,
Miguel
 
S

shapper

Hello,

Does anyone knows how to indicate which project to be build by
MSBuild?

I have the following:

Build
   |-----Build.proj
MyProject

Build is a project that when I run it in VS it calls MSBuild using
Build.proj as build information.

Build.proj is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets="All">
  <Import Project="..\properties\build.properties" />
   <Import Project="$(MSBuildProjectDirectory)\properties
\build.properties" />
  <PropertyGroup>
    <BuildPath Condition="'$(BuildPath)'==''">..\Website
\Website.csproj</BuildPath>
    <TasksPath Condition="'$(TasksPath)'==''">$(BuildPath)\Bin\Debug</
TasksPath>
  </PropertyGroup>
  <Target Name="All" DependsOnTargets="Build" />
        <!-- add custom targets below -->
        <Target Name="Build">
        </Target>
</Project>

In this moment it is builing Build itself. I know that I need to
change something so that Build starts to call MSBuild to build
MyProject but I don't know what.

I tried everything I could think of but until now I wasn't able to
make this work.

Thanks,
Miguel

Sloan,

I know but what I am trying to do is to change the Build.proj file to
start building my project ...

What would help me is to see the command window when I run Build which
seems impossible or to try to figure how to change the .proj XML file
to start building my project when I run the Build project.

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top