Hello,
thanks for your quick reply.
1. What's the version of your VS .NET, 2002 or 2003?
I am using VS .NET 2003 with .NET Framework v1.1.4322.
2. Does the problem occurs to other project say, .NET Console application,
ASP .NET Web application?
First of all, the Problem does not only occurr on my own projects, but
everything
using System.Windows.Forms, or as I show later, the .NET Framework in
general.
For example, the "Microsoft .NET Framework 1.1
Wizards" tool from "Administrative Tools" fails with exactly the same
reason.
The NVIDIA SDK Browser, from NVIDIAS new SDK 7 also fails with the same
error but this time with the "Additional Information: Unknown Error".
Console applications are also affected. For my little testing app, the error
is:
An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in Unknown Module.
Additional information: Cannot create a file when that file already exists.
Note here the "Unknown Module". I think the code to reproduce the error is
small enough that I can post it, so you can see, I am doing nothing
extraordinary:
static void Main(string[] args)
{
System.Console.WriteLine("Hello World");
System.DateTime d1 = System.DateTime.Now;
d1 = d1.AddSeconds(60);
while (true)
{
System.DateTime d2 = System.DateTime.Now;
if (RoughlyEquals(d1,d2,10,60*60*2))
{
System.Console.WriteLine("Time Hit...");
break;
}
}
}
Where "RoughlyEquals" is the sample function provided in the MSDN Library
on the manual page for DateTime.
The call stack for this app is:
7ffe0304()
ntdll.dll!77f5c534()
kernel32.dll!_WaitForSingleObjectEx@12() + 0x8b
kernel32.dll!_WaitForSingleObject@8() + 0xf
mscorwks.dll!792952f6()
mscorwks.dll!792967c0()
mscorwks.dll!7924629f()
mscorwks.dll!7939f184()
mscorwks.dll!7939f32a()
mscorwks.dll!792adb55()
kernel32.dll!_IsBadReadPtr@8() + 0x5f
mscorwks.dll!792adc41()
nview.dll!1009a575()
kernel32.dll!_UnhandledExceptionFilter@4() + 0x60
kernel32.dll!_BaseProcessStart@4() + 0x12334
Note that the waiting is neccesarry to reproduce the error. If I just write
a "Hello World" it works just fine and exits. Only when the application runs
"long enough", the COMException occurrs.
I am really not into ASP .NET, so I don't have tried that one. But since
the console app fails I strongly assume that this will fail, too. If its
absolutely
crucical for you to know, I will produce a sample.
3. What's the detailed information of the exception? For example, the
content of call stack.
The exact error is (for the System.Windows.Forms app now) :
An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in system.windows.forms.dll
Additional information: Cannot create a file when that file already exists.
This is the call stack:
system.windows.forms.dll!System.Windows.Forms.Application.ComponentManager.S
ystem.Windows.Forms.UnsafeNativeMethods+
IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason, int
pvLoopData) + 0x53e bytes
system.windows.forms.dll!ThreadContext.RunMessageLoopInner(int reason,
System.Windows.Forms.ApplicationContext context) + 0x15f bytes
system.windows.forms.dll!ThreadContext.RunMessageLoop(int reason,
System.Windows.Forms.ApplicationContext context) + 0x45 bytes
system.windows.forms.dll!System.Windows.Forms.Application.Run(System.Windows
..Forms.Form mainForm) + 0x34 bytes
WindowsApplication1.exe!WindowsApplication1.Form1.Main() Line 67 C#
This is all information I can get.
I assume there is more wrong about this, because I am not able to Debug .NET
Applications
with Visual Studio as it seems. At least not in the instance of it that I
used to run the App, for I
get the message JIT Debugging would not be enabled, though it is. Stepping
into the code or halting
at Breakpoints also does not work - like say I never set a Breakpoint or hit
F11 but just clicked run.
I just got to the call stack by attaching a new Visual Studio instance.
4. You can use Filemon to monitor the file access to check which file may
cause the problem. You can download the tool at
http://www.sysinternals.com/ntw2k/source/filemon.shtml.
I have tried that, but I could not find an error that suggests an already
existing file.
What I found is some PATH NOT FOUND and BUFFER OVERFLOW errors, but
I cannot tell if that has anything to do with it, I paste some of the
relevant lines for the ConsoleApplication
here:
ConsoleApplicat:2904 OPEN
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\en\MSCORRC.DLL
PATH NOT FOUND Options: Open Access: All
ConsoleApplicat:2904 OPEN
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\en-US\MSCORRC.DLL
PATH NOT FOUND Options: Open Access: All
ConsoleApplicat:2904 QUERY INFORMATION
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\MSCORRC.DLL
BUFFER OVERFLOW FileFsVolumeInformation
I know .NET applications worked fine, when I once did a fresh setup of my
machine in January.
Since then I have installed lots of additional Programs and tools - and used
..NET only sparely,
so I cannot tell if anything of that caused my trouble. Most of the time,
I'm working with native
applications, and I have no problem with them - debugging a native app also
works as expected in
Visual Studio.
I would be glad if you can help me to resolve this issue, so I can avoid
reinstalling my machine and
I hope the information I provided will suffice - let me know if I forgot
something.
Greetings,
Matthias