PerformanceCounterCategory.Create throws IOException

  • Thread starter Thread starter perlesnews
  • Start date Start date
P

perlesnews

While testing the use of performance counters, IOException(file exists)
is detected (see stack trace above). We are using Framework.net 1.1

The reason is that the temporary folder is plenty of temporary files. I
am quite sure almost all these files files were created by
PerformanceCounter use related calls.

If files are removed manually, the IOException does not happen.

It is expected that the creator of a temporary file is the reposnsible
to remove it.

My quesiton is: does Framerwork.Net "forget" to remove these files?
Why?

Thanks in advance,
ivan


at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.Path.GetTempFileName()
at System.Diagnostics.PerformanceCounterLib.get_IniFilePath()
at System.Diagnostics.PerformanceCounterLib.CreateIniFile(String
categoryName, String categoryHelp, CounterCreationDataCollection
creationData, String[] languageIds)
at System.Diagnostics.PerformanceCounterLib.RegisterCategory(String
machineName, String categoryName, String categoryHelp,
CounterCreationDataCollection creationData)
at System.Diagnostics.PerformanceCounterCategory.Create(String
categoryName, String categoryHelp, CounterCreationDataCollection
counterData, String machineName, String localizedIniFilePath)
at System.Diagnostics.PerformanceCounterCategory.Create(String
categoryName, String categoryHelp, CounterCreationDataCollection
counterData)
 
Indeed very strange because Path.GetTempFileName() which is causing the
exception shouldn't according to the documentation, cause any exceptions at
all.
maybe there is no free number for a temporary file left or the system
doesn't have access to the temp folder.
 
Thanks for your answer.

You are right, the reason for the exception is that there is no free
number for a temporary file left.

The thing I don't understand is why so many temporary files exist
there. I think it is a consequence of using performance counters, since
that is the most recent feature in our software and before that, we had
no problems with temporary files.
 
I found the error after more tests.

It was my fault. It is our software the one that creates temporary
files and does not remove them after using...

Sorry!
 
Back
Top