Run code on Visual Studio with non admin rights

Albert Ashkhatoyan 21 Reputation points
2022-09-29T10:25:23.037+00:00

Hi, all we have a code that affects local IIs. Sure it requires Local admin rights.
can we run the code with the non-admin users?

Internet Information Services
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.
945 questions
{count} votes

Accepted answer
  1. XuDong Peng-MSFT 10,101 Reputation points Microsoft Vendor
    2022-09-30T07:36:09.13+00:00

    Hi @Albert Ashkhatoyan ,

    Hi, all we have a code that affects local IIs. Sure it requires Local admin rights.
    can we run the code with the non-admin users?

    In fact, this is clearly mentioned in the official documentation: You must run Visual Studio as an administrator in order to work with IIS. In your case, we generally recommend that you use IIS express. For more details, please refer to this part of the relevant description: https://learn.microsoft.com/en-us/previous-versions/aspnet/58wxa9w5(v=vs.120)?redirectedfrom=MSDN#disadvantages-of-using-iis-as-a-development-web-server.

    So I don't think you need to consider the possibility of this requirement anymore.

    Best regards,
    Xudong Peng


    If the answer is the right solution, please click "Accept Answer" and kindly upvote. 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.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,686 Reputation points
    2022-09-29T15:19:15.653+00:00

    there is nothing magic about visual studio that will allow to have more rights than the user. in fact this feature does not exist in windows (an app having more permissions than the user). The standard approach to handle elevated permissions is to create a service that runs under an admin account.

    if you developers need to use IIS, then visual studio needs admin rights, and the developer needs admin rights to run VS as admin.

    0 comments No comments