.NET Creating a Semaphore fails with IoException on Win 2008

Viewed 390

The following code is failing for me on Windows 2008. It succeeds in Win7.

return new Semaphore(1, 1, "my-test-semaphore");

I get the following error:

System.IO.IOException: The specified port does not exist.
  at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
  at System.IO.Ports.InternalResources.WinIOError()
  at System.Threading.Semaphore..ctor(Int32 initialCount, Int32 maximumCount, String name)
  at Throttle.Program.CreateSemaphore(String passthroughApplication)
  at Throttle.Program.Main(String[] args)

I've searched around and can't find an explanation. Does anyone have any ideas?

1 Answers
Related