From: SourceForge.net <no...@so...> - 2009-05-09 15:45:29
|
Bugs item #2789448, was opened at 2009-05-09 20:45 Message generated for change (Tracker Item Submitted) made by vsevolodp You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402868&aid=2789448&group_id=31650 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Vsevolod Parfenov (vsevolodp) Assigned to: Nobody/Anonymous (nobody) Summary: The process cannot access the tmp file Initial Comment: when I start NAnt I see error: "BUILD FAILED Failed to initialize the 'Microsoft .NET Framework 2.0' (net-2.0) target framework. The process cannot access the file 'C:\Documents and Settings\User\Local Settings\Temp\tmp2E.tmp' because it is bein g used by another process." It occures only when the one Kaspersky Internet Security 2009 module is started ("Proactive Defense"). For details see NAnt output with -debug in attachment Following diff can be used to correct this: --------------------------------------------------------------------- --- C:\projects_local\nant-0.86-beta1\src\NAnt.Core\FrameworkInfo.cs.orig Tue Apr 28 13:52:16 2009 UTC +++ C:\projects_local\nant-0.86-beta1\src\NAnt.Core\FrameworkInfo.cs Tue Apr 28 13:58:16 2009 UTC @@ -744,39 +581,15 @@ throw new ArgumentException("No <project> node is defined."); } - string tempBuildFile = Path.GetTempFileName(); - XmlTextWriter writer = null; Project frameworkProject = null; - try { - // write project to file - writer = new XmlTextWriter(tempBuildFile, Encoding.UTF8); - writer.WriteStartDocument(true); - writer.WriteRaw(projectNode.OuterXml); - writer.Flush(); - writer.Close(); - - // use StreamReader to load build file from to avoid - // having location information as part of the error - // messages - using (StreamReader sr = new StreamReader(new FileStream(tempBuildFile, FileMode.Open, FileAccess.Read, FileShare.Write), Encoding.UTF8)) { XmlDocument projectDoc = new XmlDocument(); - projectDoc.Load(sr); + projectDoc.LoadXml(projectNode.OuterXml); // create and execute project frameworkProject = new Project(projectDoc); frameworkProject.BaseDirectory = AppDomain.CurrentDomain.BaseDirectory; frameworkProject.Execute(); - } - } finally { - if (writer != null) { - writer.Close(); - } - - if (File.Exists(tempBuildFile)) { - File.Delete(tempBuildFile); - } - } XmlNode runtimeNode = _frameworkNode.SelectSingleNode ("runtime", NamespaceManager); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402868&aid=2789448&group_id=31650 |