Visual Studio Error – Unable to access the IIS metabase

Tried to deploy a SharePoint 2010 build via Visual Studio 2015.

Got the following error:

Unable to access the IIS metabase. You do not have sufficient privledge to access IIS web sites on your machine.

On the server/workstation, click run and enter the following path:

%systemroot%\System32\inetsrv\config

You will be prompted with a window to grant permissions to the folder and click yes.

I performed this and still no luck.

The solution was to run Visual Studio as Administrator. And the solution was able to build.