G
Guest
Hi,
I am facing a strange problem.
I am using c# 1.1, Visual Studio 2003 on Windows XP SP2
I have a middle-tier project that calls some win32 api's like OpenMutex,
CreateMutex etc (the Mutex class in c# 1.x is not helpful enough). The
middle-tier project is used by a Windows App and a web app.
The problem is running the windows app:
* If visual studio is running then both OpenMutex and CreateMutex fail with
win32 error code 5 which when read using new Win32Exception(); contains
message Access is denied.
* However if i close VS.NET and then run the compiled application it doesn't
throw this errror any more. The OpenMutex / CreateMutex behave as they should.
* If i create a console application and use the same code, the code works
fine (with or without vs.net running)
I have tried the following:
* Mark the class as unsafe and in project enabled allow unsafe blocks
* Added SecurityPermission attribute using SecurityAction.LinkDemand,
enabling unmanaged = true
I would be very thankful if any one has had similar problems and knows of
any known workarounds.
I am facing a strange problem.
I am using c# 1.1, Visual Studio 2003 on Windows XP SP2
I have a middle-tier project that calls some win32 api's like OpenMutex,
CreateMutex etc (the Mutex class in c# 1.x is not helpful enough). The
middle-tier project is used by a Windows App and a web app.
The problem is running the windows app:
* If visual studio is running then both OpenMutex and CreateMutex fail with
win32 error code 5 which when read using new Win32Exception(); contains
message Access is denied.
* However if i close VS.NET and then run the compiled application it doesn't
throw this errror any more. The OpenMutex / CreateMutex behave as they should.
* If i create a console application and use the same code, the code works
fine (with or without vs.net running)
I have tried the following:
* Mark the class as unsafe and in project enabled allow unsafe blocks
* Added SecurityPermission attribute using SecurityAction.LinkDemand,
enabling unmanaged = true
I would be very thankful if any one has had similar problems and knows of
any known workarounds.