You do not have sufficient privilege to access IIS websites on your machine

·

3 min read

The MetaBase is an internal database used by Microsoft's Internet Information Services to store information. The Metabase is a hierarchical, inheritable database that enables HTTP/HTTPS, FTP, SMTP, and NNTP setup at the server, site, folder, and file level. IIS employs different formats with the different versions; previous to IIS version 6, this was always a proprietary format, however, data is now kept in XML files with 6.0 and beyond. MetaBase.xml and MBSchema.xml are two files in the SystemRoot inetsrv directory that make up the Metabase. The Metabase is backed up to the MetaBack subdirectory regularly.

When IIS starts, it reads the two Metabase files and creates an in-memory cache of the web server's configuration called the in-memory Metabase. IIS configuration changes made via the IIS Manager or programmatically are written to the in-memory Metabase, which is then persisted to the on-disk MetaBase.xml file after several modifications.

Image description

What is “You do not have sufficient privilege to access IIS website on your machine”.

IIS uses a copy of the Metabase that has been loaded into memory. Changes to the Metabase configuration are instantly reflected in the in-memory Metabase, but not in the physical Metabase files.

When the current in-memory Metabase is copied to the disc, the prior copy of the Metabase on the disc is written to a history file.

You're working on a project with an IIS-enabled web application. However, you lack appropriate credentials to access IIS websites on your workstation, preventing you from accessing IIS metabases. You could get this message if you're working on a project where you don't have this permission.

Reasons that may cause to appear this message.

The difficulty with switching from IIS Express to IIS is that Visual Studio is unable to access the IIS Metabase with the current user privileges, leaving the user with no choice but to instantly elevate their privileges. A popup message might appear and intimate the error message.

error: The Web Application Project Know.WebSite is configured to use IIS. Unable to access the IIS Metabase. You do not have sufficient privilege to access IIS websites on your machine.

What the Solutions are.

We have two options for dealing with these issues. To start Visual Studio with Administrator privileges. Permanently grant the current user rights to the IIS Metabase folder.

The Solution One.

Amin has all permissions on the PC he is using, so right-click on VS and run as administrator. This option may appear viable, but it has some drawbacks, the most annoying of which is that you won't be able to drag/drop or cut/paste between the Visual Studio Solution Explorer and the Windows Explorer because the system won't allow two Explorer instances with different privileges to interact.

The Solution Two.

The second choice is unquestionably more practical. To get it started, press

Win + E

to launch Windows Explorer, then type the following line in the topmost address bar, depending on the OS you're using:

Windows 8 Professional

%systemroot%\inetsrv\config

Windows 7, Windows 8.1, and Windows 10

%systemroot%\System32\inetsrv\config

A message will show as soon as you press the Enter key, asking if you wish to permanently allow the current user access to that folder.

Click the Continue button, then use a couple of mouse clicks to open the Export subfolder and repeat the process.

You've done it: now you can start Visual Studio with default permissions, and your IIS instance will run smoothly.

The Conclusion.

In this article, I explained the issue, its reasons, and possible solutions. Finding a solution to anything can be difficult but not impossible. I am always available to answer any further inquiries. You can ask in the feedback section or the comments.