Run code on Visual Studio with non admin rights

Albert Ashkhatoyan 26 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?

Windows development | Internet Information Services
Developer technologies | Visual Studio | Debugging
{count} vote

Accepted answer
  1. Anonymous
    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) 77,686 Reputation points Volunteer Moderator
    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

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.