C
C#2y ago
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
16 Replies
Peacemaker
PeacemakerOP2y ago
Could it be something with the code ? I see no IIS Express logs :/ is there any way I could find some logs to help solving this question
Tvde1
Tvde12y ago
IIS express 😬 is there an alternative? I don't know anyone that uses IIS anymore
Peacemaker
PeacemakerOP2y ago
oooh is it that ancient ? 😄 I was just instructed to use IIS Express, other choices like https/http debug threw an error
Tvde1
Tvde12y ago
what kind of a front-end do you have?
Peacemaker
PeacemakerOP2y ago
update: I don't know what I have done, but https debug "works" now with same response pure html css js no api fetching
Tvde1
Tvde12y ago
and you're running it locally or on a server?
Peacemaker
PeacemakerOP2y ago
cloned repo running it locally meaning invalid hostname
Tvde1
Tvde12y ago
you can just open the html file in your browser
Peacemaker
PeacemakerOP2y ago
the company has setup pipeline around .net, I will try to talk about options with them or I could just copy and paste the code from my local html,css,js thing hoping it will work since cloned code is from live server, dunno 😄 life is strange vice versa of "it works on my machine" 😄 😄 😄
Tvde1
Tvde12y ago
What makes you ask that?
Peacemaker
PeacemakerOP2y ago
Yep. I've given up, now I just copy paste from local files into cloned files -> pull request and pray to god this time there are no issues I've even tried commenting out the "::1 localhost" from hosts file in windows>system32>.. dont remember full path kek
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Peacemaker
PeacemakerOP2y ago
when dont try me Accord
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Peacemaker
PeacemakerOP2y ago
life is strange, I can say with 100% confidence I have something out of the ordinary setup in windows. Bindings are correctly setup in IIS Express, Hosts file in windows drivers looks fine, Only thing I would be sussy of is Windows Subsystem Linux which docker is using all the time
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server