Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6905743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:13:17+00:00 2026-05-27T08:13:17+00:00

I am creating and using mutex in a windows service using(var m = new

  • 0

I am creating and using mutex in a windows service

using(var m = new Mutex(false,"mymutex")
{
    m.WaitOne();
    //to my things for a long time
    m.ReleaseMutex();
 }

On another program running with Administrator rights I do

Mutex.OpenExisting("mymutex")

and it throws mutex does not exist. I can see in the Resource manager that windows service has reference to the mutex.

What is wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:13:18+00:00Added an answer on May 27, 2026 at 8:13 am

    Operating system objects like Mutex have session scope. Your service runs in session 0 so its mutex is not visible to processes that run on the desktop session. The workaround is simple, prefix Global\ to the mutex name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to creating installers using Visual Studio, and was wondering about the Global
I have some IronPython code that is creating a Mutex using the following constructor:
I've been successfully creating a .net mutex like this: SingleIns = new Mutex(true, AppName);
I'm new creating applications using Visual Studio 2010 and Microsoft Access 2007. I already
I am creating cookie using jquery, please see below code: var divID = $(link).next(.open-block-holder).find(div:first).attr(id);
Context I'm using sqlite version 3.7.7.1 in a Windows C++ program, I'm creating a
I am new in creating application using Visual Studio 2010 C#. I am creating
When creating reports using BIRT 2.3.1, I don't want page breaks inside tables or
I am using creating a server/client style program, and it uses tcp connections. Now,
I am creating reports using the Microsoft ReportViewer control. I am encountering some formatting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.