1
votes

I've looked for an answer to my above question, but none of the answers at the similarly-named questions below worked for me. The primary difference appears to be that I'm using Visual Studio 2017:

How to change IIS Express site name in Visual studio project

IIS Express Visual Studio Integration - Changing site name

How to rename an IIS Express website in Visual Studio 2012

1
must be something inside the launchsettings.json. I find the rest of the settings in this fileNeville Nazerane
The site name is part of IIS Express configuration file, so you should be able to manually change that, docs.jexusmanager.com/getting-started/… Microsoft changed that in VS2015, so when you search for existing threads, most likely you should use VS2015 in keywords.Lex Li

1 Answers

1
votes

In VS2017, the file you're looking for is located in a subfolder of your solution folder:

RootSolutionFolder\.vs\config\applicationhost.config

It contains all the IIS express configuration for your solution. The easiest way to fix incorrect settings is to remove this file altogether, because Visual Studio will then recreate it.

If you prefer to edit it, you should look for the <sites> tag, and you should see a list of the configured sites. For example, mine looks like this:

<sites>
  <site name="WebSite1" id="1" serverAutoStart="true">
    <application path="/">
      <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation=":8080:localhost" />
    </bindings>
  </site>
  <site name="MyAspNetCoreWebsite" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
      <virtualDirectory path="/" physicalPath="D:\MyAspNetCoreWebsite" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation="*:50693:localhost" />
      <binding protocol="https" bindingInformation="*:44363:localhost" />
    </bindings>
  </site>
  <siteDefaults>
    <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
    <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
  </siteDefaults>
  <applicationDefaults applicationPool="Clr4IntegratedAppPool" />
  <virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>

From there, simply find the <site name==""> attribute you want to change.

Note that you might need to restart Visual Studio.