Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / November 2005

Tip: Looking for answers? Try searching our database.

Referencing Custom MSBuildTasks in a CRPROJ

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Howard Hoffman - 23 Nov 2005 20:47 GMT
Is it possible to reference a custom MSBuild task in a CSPROJ?

This is what I'm trying to do, basically:

(1) Run a custom code generator to generate a CS file
(2) Add the CS file to the CSPROJ
(3) Build the CSPROJ

The code generator has several inputs.  I've created a custom MSBuild task
to encapsulare capturing those inputs and passing them on to the code
generator.

I've figured out how to create a custom Target in my CSPROJ, based on my
custom MSBuild task.  I can run MSBuild from the command line and direct it
to build my custom Target.

What I'm not quite getting is how I can do this from inside the VS.NET
IDE -- that is, how I can build my SLN (or CSPROJ) such that my custom
Target is built first.

I'm feeling like this maybe a dumb question, but I'm stuck nonetheless.

Thanks in advance.

Howard Hoffman
"Gary Chang[MSFT]" - 24 Nov 2005 06:51 GMT
Hi Howard,

>What I'm not quite getting is how I can do this from inside
>the VS.NET IDE -- that is, how I can build my SLN
>(or CSPROJ) such that my custom Target is built first.

Have you tried to run the run MSBuild command line in the Build
Event/Pre-Build Event, you can specify some commands(separate by
semi-comma) that occurs before the build process. please refer to the
following KB for the details:

HOW TO: Implement Build Events in Visual C# .NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;810230

Thanks!

Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Sayed Ibrahim Hashimi - 28 Nov 2005 16:46 GMT
You may want to put the target(s) in the InitialTargets list. Have a look at:
<a
href="http://msdn2.microsoft.com/en-us/library/ms171463.aspx">http://msdn2.microsoft.c
om/en-us/library/ms171463.aspx</a
>

The InitialTargets list will execute before any other targets.

Hope that helps,
Sayed Ibrahim Hashimi

> Is it possible to reference a custom MSBuild task in a CSPROJ?
>
[quoted text clipped - 21 lines]
>
> Howard Hoffman

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.