Bugs item #2789448, was opened at 2009-05-09 17:45
Message generated for change (Settings changed) made by drieseng
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: Framework support
>Group: cvs
>Status: Closed
>Resolution: Fixed
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);
----------------------------------------------------------------------
>Comment By: Gert Driesen (drieseng)
Date: 2009-05-10 15:21
Message:
The problem was that we were creating a filestream with write fileshare;
this denied read access to other processes (such as an anti-virus).
But writing the project XML to file was indeed not necessary, so I removed
this.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=2789448&group_id=31650
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
nant-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-developers