© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
26 replies
Peacemaker

❔ VS Debug Bad Request - Invalid Hostname

I am new to dot net and I am supposed to implement some frontend. I have cloned the project, I am supposed to run it on IIS Express. I've fixed ssl certificate and now I'm facing Bad Request Invalid Hostname when I run debug on IIS Express in Visual Studio..

I've tried changing both ...\Site\Site.vs\Site\config\applicationhost.config and ~documents\IIS Express\config\applicationhost.config

like so:

<site name="Site" id="1">
        <application path="/" applicationPool="Site AppPool">
          <virtualDirectory path="/" physicalPath="My\Path\.." />
        </application>
        <bindings>
          <binding protocol="http" bindingInformation="*:4300:localhost" />
          <binding protocol="https" bindingInformation="*:44395:localhost" />
        </bindings>
      </site>
<site name="Site" id="1">
        <application path="/" applicationPool="Site AppPool">
          <virtualDirectory path="/" physicalPath="My\Path\.." />
        </application>
        <bindings>
          <binding protocol="http" bindingInformation="*:4300:localhost" />
          <binding protocol="https" bindingInformation="*:44395:localhost" />
        </bindings>
      </site>


I've tried changing browsers, deleting ...\Site.vs folder and then running it again
None of those worked
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Bad Request issue
C#CC# / help
2d ago
❔ Bad request (400) - web api
C#CC# / help
3y ago
Asp.net Core bin vs bin/debug
C#CC# / help
15mo ago
✅ VS "cs1525 invalid expression term '{' " error when I change a variable value in debug mode
C#CC# / help
3y ago