By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,671 Members | 1,556 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,671 IT Pros & Developers. It's quick & easy.

Run NAnt from my own application

P: n/a
I have figured out how to get this running by using Ant.Console as a
starting point for calling NAnt. I had to include NAnt.Core,
NAnt.DotNet & NDoc.Core in my project and it worked correctly.

But, since I already have NAnt installed on my system, I was hoping
that I would not need to include references to NAnt.Core, NAnt.DotNet
& NDoc.Core

I removed the references and set my path environment varible to point
at the NAnt\bin folder but there is a failure at this line:

Assembly nantCore =
AppDomain.CurrentDomain.Load("NAnt.Core");
Unhandled Exception: System.IO.FileNotFoundException: File or assembly
name NAnt.Core, or one of its dependencies, was not found.
File name: "NAnt.Core"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me
assemblyRef, Boolean stringized, Evidence assemblySecurity,
StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.AppDomain.Load(String assemblyString)
at Test.External.Ant.HelperArguments.CallConsoleRunne r() in
c:\_applicationsvs\mftest\external\ant\antcontroll er.cs:line 215
at System.AppDomain.DoCallBack(CrossAppDomainDelegate
callBackDelegate)
at Test.External.Ant.AntController.execute(String[] args) in
c:\_applicationsvs\mftest\external\ant\antcontroll er.cs:line 113
at Test.Form1.btnRunAnt_Click(Object sender, EventArgs e) in
c:\_applicationsvs\mftest\form1.cs:line 547
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG&
msg)
at System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeMethods+IMsoComponentManager. FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopI nner(Int32
reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Test.Form1.Main() in c:\_applicationsvs\mftest\form1.cs:line 425

Cheers Dave
Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.