Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the urvanov-syntax-highlighter domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/controll/public_html/wp-includes/functions.php on line 6114
Getting IIS Express to listen on a network LAN IP with visual studio. – ControllingTheInter.net

Getting IIS Express to listen on a network LAN IP with visual studio.

Normally my post arnt so short but this burned 45 minutes of my time as I struggled to get a native IIS express deployment from VS2022 to use a lan port for debugging remote connections.

Navigate to \RootProjectDirectory\.vs\{ProjectName}\config\applicationhost.config

Run Visual Studio as Administrator, this is critical.
Delete the file after backing it up, then while in Visual studio click Create Virtual Directory using a different port on HTTP then the one you wish to open on lan
Start the project, then Stop debugging. Once Stopped, confirm IIS is no longer running on the taskbar.

Open the newly generated applicationhost.config file within the config directory and add the new binding, mine existed on line 168.

<binding protocol=”http” bindingInformation=”*:44392:{PUT LAN IP HERE}” />

An example of the config will look 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=”ProjectName” id=”2″>
<application path=”/” applicationPool=”Clr4IntegratedAppPool”>
<virtualDirectory path=”/” physicalPath=”C:\Users\User\source\repos\ProjectName\ProjectName” />
</application>
<bindings>
<binding protocol=”http” bindingInformation=”*:44391:localhost” />
<binding protocol=”http” bindingInformation=”*:44392:192.168.0.199″ />
</bindings>
</site>
<siteDefaults>
<!– To enable logging, please change the below attribute “enabled” to “true” –>
<logFile logFormat=”W3C” directory=”%AppData%\Microsoft\IISExpressLogs” enabled=”false” />
<traceFailedRequestsLogging directory=”%AppData%\Microsoft” enabled=”false” maxLogFileSizeKB=”1024″ />
</siteDefaults>
<applicationDefaults applicationPool=”Clr4IntegratedAppPool” />
<virtualDirectoryDefaults allowSubDirConfig=”true” />
</sites>

Save, then click Start debug within VS. You may now HTTP from your other machine using the newly added port.

Leave a comment

Your email address will not be published. Required fields are marked *