Here is a fix for the problem area.  My assumption was this code was trying
to determine the nant.exe file that was running, what folder it was in, and
what the verison number was.  I changed the code to use reflection and now
I can't reproduce my problem.  This code goes in the project.cs around line
74 ish.

OLD
ProcessModule module = Process.GetCurrentProcess().MainModule;
FileVersionInfo versionInfo =
FileVersionInfo.GetVersionInfo(module.FileName);
Properties.AddReadOnly("nant.filename", versionInfo.FileName);
Properties.AddReadOnly("nant.version",  versionInfo.FileVersion);
Properties.AddReadOnly("nant.location",
Path.GetDirectoryName(module.FileName));

NEW
Assembly currentAssembly = Assembly.GetExecutingAssembly();
Properties.AddReadOnly("nant.filename", currentAssembly.Location);
Properties.AddReadOnly("nant.version", currentAssembly.GetName
().Version.ToString());
Properties.AddReadOnly("nant.location",
Path.GetDirectoryName(currentAssembly.Location));



                                                                                       
                                                       
                    "Scott                                                             
                                                       
                    Hernandez"           To:     [EMAIL PROTECTED], 
[EMAIL PROTECTED]                           
                    <skot@eorbit.        cc:                                           
                                                       
                    net>                 Subject:     RE: [nant-dev] Multiple build 
files error?                                              
                                                                                       
                                                       
                    06/12/2002                                                         
                                                       
                    05:12 PM                                                           
                                                       
                                                                                       
                                                       
                                                                                       
                                                       




Nope.

I am a little worried about the fact that the call goes all the way out
to the system process manager and back. I know there is another way to
get the moduleinfo without inspecting the process. It can be done via
the Assembly.

This isn't really a great solution as I have no idea why the problems
happen, but it might fix the problem.

> -----Original Message-----
> From: [EMAIL PROTECTED]
[mailto:nant-developers-
> [EMAIL PROTECTED]] On Behalf Of [EMAIL PROTECTED]
> Sent: Wednesday, June 12, 2002 2:28 PM
> To: [EMAIL PROTECTED]
> Subject: [nant-dev] Multiple build files error?
>
> I'm getting this error when I'm using nant to perform a build using
> multiple build files.  Here's what I've got.
>
> I've got 2 build files (A & B) that are called from a master build
file
> (M).
>
> First I call a target in both build files A & B using the nant task
from M
>      A.SomeTarget
>      B.SomeTarget
>
> Then I call another target in both build files
>
>      A.SomeOtherTarget
>      B.SomeOtherTarget
>
> That's when I get the error below (at A.SomeOtherTarget call) .  And
it is
> very intermittent.  Has anyone had this problem before.  I have copied
the
> line of code that the error is getting thrown on.  I was wondering if
the
> file handle is busy and it can't be processed or something?  Anyone
seen
> this before and solved it?
>
> Project.cs (line 304)
> ProcessModule module = Process.GetCurrentProcess().MainModule;
>
> Exception from NAnt.exe
>
> copy-released:
>     [sleep] Sleeping for 3000 milliseconds
>      [nant] U:\Assemblies\Voyager.Apps.Build\Voyager.Apps.Build.build
> copy-released
>
> INTERNAL ERROR
> System.ComponentModel.Win32Exception: The handle is invalid
>    at System.Diagnostics.NtProcessManager.GetModuleInfos(Int32
processId)
>    at System.Diagnostics.Process.get_Modules()
>    at System.Diagnostics.Process.get_MainModule()
>    at SourceForge.NAnt.Project.InitializeProject(XmlDocument doc) in
C:
> \download\sourceforge\nant\nant-snapshot-20020507
> \nant\src\NAnt\Project.cs:line 304
>    at SourceForge.NAnt.Project.ctorHelper(XmlDocument doc) in C:
> \download\sourceforge\nant\nant-snapshot-20020507\nant\s
> rc\NAnt\Project.cs:line 85
>    at SourceForge.NAnt.Project..ctor(String source) in C:
> \download\sourceforge\nant\nant-snapshot-20020507\nant\src\NAnt
> \Project.cs:line 77
>    at SourceForge.NAnt.Tasks.NantTask.ExecuteTask() in C:
> \download\sourceforge\nant\nant-snapshot-20020507\nant\src\NAnt
> \Tasks\NantTask.cs:line 66
>    at SourceForge.NAnt.Task.Execute() in C:
> \download\sourceforge\nant\nant-snapshot-
> 20020507\nant\src\NAnt\Task.cs:line
> 95
>    at SourceForge.NAnt.Target.Execute() in C:
> \download\sourceforge\nant\nant-snapshot-
> 20020507\nant\src\NAnt\Target.cs:l
> ine 125
>    at SourceForge.NAnt.Project.Execute(String targetName) in C:
> \download\sourceforge\nant\nant-snapshot-20020507\nant\sr
> c\NAnt\Project.cs:line 223
>    at SourceForge.NAnt.Tasks.CallTask.ExecuteTask() in C:
> \download\sourceforge\nant\nant-snapshot-20020507\nant\src\NAnt
> \Tasks\CallTask.cs:line 47
>    at SourceForge.NAnt.Task.Execute() in C:
> \download\sourceforge\nant\nant-snapshot-
> 20020507\nant\src\NAnt\Task.cs:line
> 95
>    at SourceForge.NAnt.Target.Execute() in C:
> \download\sourceforge\nant\nant-snapshot-
> 20020507\nant\src\NAnt\Target.cs:l
> ine 125
>    at SourceForge.NAnt.Project.Execute(String targetName) in C:
> \download\sourceforge\nant\nant-snapshot-20020507\nant\sr
> c\NAnt\Project.cs:line 223
>    at SourceForge.NAnt.Project.Execute() in C:
>
\download\sourceforge\nant\nant-snapshot-20020507\nant\src\NAnt\Project.
cs
> :line 208
>    at SourceForge.NAnt.Project.Run() in C:
> \download\sourceforge\nant\nant-snapshot-
> 20020507\nant\src\NAnt\Project.cs:lin
> e 242
>
>
>
>
> _______________________________________________________________
>
> Sponsored by:
> ThinkGeek at http://www.ThinkGeek.com/
> _______________________________________________
> Nant-developers mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-developers










_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - 
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink

_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to