How to Debug WCF Project Using Visual Studio as Non Administrator

Ali basha Syed 20 Reputation points
2024-12-20T17:00:57.7366667+00:00

When I open Visual Studio 2022 as Admin, I can able to easily run our WCF Project which is having Net Tcp Binding, but when opened VS 2022, as Non Admin and Run this Project, I am getting the below exception.

"'The service endpoint failed to listen on the URI 'net.tcp://localhost:50000/LoginService.svc' because access was denied. Verify that the current user is granted access in the appropriate allowAccounts section of SMSvcHost.exe.config.'"

I tried both the answers given by ChatGpt, i.;e 1. Modified the SMSvcHost.exe.config and added specific user. 2. Reserve the URL for the service.

Both are not working.

Any help would be highly appreciated. Thanks.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,008 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,012 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 30,386 Reputation points Microsoft Vendor
    2024-12-23T05:39:33.5666667+00:00

    Hi @Ali basha Syed

    Welcome to Microsoft Q&A! 

    WCF services requires administrator rights.

    The error message also means that you need elevated privileges to debug the application. 

    I suppose you must run the VS as administrator to run the WCF project. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".  Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

     


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.