Reconfigure a Project to Use IIS Express in Visual Studio

Published 26/04/2016 - Updated 27/07/2023

A profile picture of Gary Lewis Cheetham, the author of this article

Written by

Gary Lewis Cheetham

Automotive marketing specialist from Manchester, UK

Table of Contents [Show]

    Apparently, back in the day, they had enough spare RAM on their development machines to run a full copy of IIS.

    We’re not so privileged today, but if you inherit one of these projects, you may end up looking at error messages like this:

    MyProject.csproj : error  : The Web Application Project MyProject is configured to use IIS.  Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine.

    Or this:

    MyProject.csproj : error  : The Web Application Project MyProject is configured to use IIS.  The Web server 'http://www.myproject.local/' could not be found.

    Because on your weedy i7 CPU, bogged down by too many background processes, you’ve opted not to install a full copy of IIS and use IIS Express instead.

    Projects that are configured to use IIS won’t even load on machines that don’t have it installed, but fortunately, it’s easy to open up the XML in the csproj file and make the changes that you need to reconfigure the project to use IIS Express instead.

    First, you’ll need to add the UseIISExpress property and set to true in the first PropertyGroup in your csproj.

    <UseIISExpress>true</UseIISExpress>

    Then, under Project Extensions -> VisualStudio -> FlavorProperties -> WebProjectProperties, make the following changes.

    <WebProjectProperties>
        <UseIIS>False</UseIIS>
        <AutoAssignPort>True</AutoAssignPort>
        <DevelopmentServerPort>3000</DevelopmentServerPort>
        <DevelopmentServerVPath>/</DevelopmentServerVPath>
        <IISUrl>http://localhost:3000</IISUrl>
        <NTLMAuthentication>False</NTLMAuthentication>
        <UseCustomServer>False</UseCustomServer>
        <CustomServerUrl>
        </CustomServerUrl
        <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
    </WebProjectProperties>

    Clicking ‘reload project’ in your solution explorer will now load the project for you. Of course, you can change the port number to anything you want (just make sure that they match under both DevelopmentServerPort and IISUrl)

    Expert advice

    You're reading the GL Digital blog, where auto marketing experts share proven tactics to grow your dealership.

    Struggling to make good video?

    Sometimes it feels like posting on TikTok is a waste of time.

    Build a powerful local brand and watch customers roll in from TikTok.

    About the author

    A profile picture of Gary Lewis Cheetham, the founder of GL Digital Automotive Marketing, smiling outside a car dealership

    Gary Lewis Cheetham is an automotive marketing specialist, born and raised in Oldham, Greater Manchester. Gary Lewis Cheetham is the founder of GL Digital Automotive Marketing. He spent his teenage years working at the family dealership after school, learning the ropes of the car trade from the inside out.

    After moving on to working in marketing, Gary Lewis founded GL Digital in 2020 when he noticed a need for direct-to-consumer marketing platforms within the auto industry. He now strives every day to help independent dealers in the UK and US realise their potential. Gary also loves Formula 1 and motorsport.