Closed mithileshz closed 1 month ago
cc @karolz-ms
Are you using the same version of visual studio on both PCs?
Are you using the same version of visual studio on both PCs?
Also, do you have any proxies set up that might be interfering?
Are you using the same version of visual studio on both PCs?
Unfortunately not - On the other PC I am using (this one works fine) Microsoft Visual Studio Community 2022 Version 17.11.0 Preview 6.0 VisualStudio.17.Preview/17.11.0-pre.6.0+35125.118 Installed Version: Community
On the PC that has the issue, it is using the latest version of Visual Studio - it is an Intel based machine, whereas the one mentioned above is a AMD.
Also, do you have any proxies set up that might be interfering?
I do not have any proxies set up.
@mithileshz make sure that you have the latest "ASPNET and web development" VS workload installed on the misbehaving machine (run Visual Studio Installer and update or repair as appropriate). The most likely reason for this error is that the version of the Aspire tools you have inside Visual Studio is outdated.
@karolz-ms I did a repair on visual studio and that hasn't helped.
I ran dotnet workload list
and this is the output:
Installed Workload Id Manifest Version Installation Source
--------------------------------------------------------------------------------
aspire 8.2.0/8.0.100 SDK 8.0.400, VS 17.11.35222.181
Do you have any updates available?
No, I don't.
I've also uploaded my codebase to the repo here - https://github.com/mithileshz/AspireApp1
I've tried uninstalling, reinstalling VS, also done a repair. My dotnet workloads are also up to date.
If I run dotnet run
in terminal without the connection to Visual studio, I get the information about the dashboard and when I try log in, it gives me a 400. For (https://localhost:17207/login?t=9d56afcdf8f1986f38da48107a8312b1) link
Bad Request - Invalid Hostname HTTP Error 400. The request hostname is invalid.
Very strange. What version of visual studio works? (the other PC)
cc @vijayrkn any ideas?
Microsoft Visual Studio Community 2022 Version 17.11.0 Preview 6.0 VisualStudio.17.Preview/17.11.0-pre.6.0+35125.118 Installed Version: Community
This is the version that's working. Let me try to install the same one on my broken machine and see if that helps.
Here's any extra information if it helps. When running dotnet run
through cmd on the AppHost project, it doesn't have the same error as the initial one (failed to connect to IDE run session). It doesn't give any errors. However, when I click on the link to open the dashboard, I get the following in the browser.
Bad Request - Invalid Hostname
HTTP Error 400. The request hostname is invalid.
HTTP Error 400. The request hostname is invalid.
\r\n" }, "redirectURL": "", "headersSize": 135, "bodySize": 469 }, "cache": {}, "timings": { "blocked": -1, "dns": 0, "connect": 513, "ssl": 32, "send": 0, "wait": 42, "receive": 0 }, "time": 587, "_securityState": "secure", "serverIPAddress": "127.0.0.1", "connection": "17230", "pageref": "page_1" }, { "startedDateTime": "2024-09-11T21:23:02.592+01:00", "request": { "bodySize": 0, "method": "GET", "url": "https://localhost:17230/favicon.ico", "httpVersion": "HTTP/2", "headers": [ { "name": "Host", "value": "localhost:17230" }, { "name": "User-Agent", "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0" }, { "name": "Accept", "value": "image/avif,image/webp,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5" }, { "name": "Accept-Language", "value": "en-GB,en;q=0.5" }, { "name": "Accept-Encoding", "value": "gzip, deflate, br, zstd" }, { "name": "Connection", "value": "keep-alive" }, { "name": "Referer", "value": "https://localhost:17230/login?t=77291f2e389a09a26ca12df35537e203" }, { "name": "Sec-Fetch-Dest", "value": "image" }, { "name": "Sec-Fetch-Mode", "value": "no-cors" }, { "name": "Sec-Fetch-Site", "value": "same-origin" }, { "name": "Priority", "value": "u=6" }, { "name": "Pragma", "value": "no-cache" }, { "name": "Cache-Control", "value": "no-cache" }, { "name": "TE", "value": "trailers" } ], "cookies": [], "queryString": [], "headersSize": 534 }, "response": { "status": 400, "statusText": "", "httpVersion": "HTTP/2", "headers": [ { "name": "content-type", "value": "text/html" }, { "name": "date", "value": "Wed, 11 Sep 2024 20:23:01 GMT" }, { "name": "server", "value": "Kestrel" }, { "name": "content-length", "value": "334" }, { "name": "X-Firefox-Spdy", "value": "h2" } ], "cookies": [], "content": { "mimeType": "text/html", "size": 334, "text": "\r\nHTTP Error 400. The request hostname is invalid.
\r\n" }, "redirectURL": "", "headersSize": 135, "bodySize": 469 }, "cache": {}, "timings": { "blocked": -1, "dns": 0, "connect": 0, "ssl": 0, "send": 0, "wait": 4, "receive": 0 }, "time": 4, "_securityState": "secure", "serverIPAddress": "127.0.0.1", "connection": "17230", "pageref": "page_1" } ] } } ```Here is the output of dotnet run
info: Aspire.Hosting.DistributedApplication[0]
Aspire version: 8.2.0+75fdcff28495bdd643f6323133a7d411df71ab70
info: Aspire.Hosting.DistributedApplication[0]
Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
Application host directory is: {REDACTED}AppHost
info: Aspire.Hosting.DistributedApplication[0]
Now listening on: https://localhost:17230
info: Aspire.Hosting.DistributedApplication[0]
Login to the dashboard at https://localhost:17230/login?t=b83f990577356a834d9483a2dcfddcc4
info: Aspire.Hosting.DistributedApplication[0]
Distributed application started. Press Ctrl+C to shut down.
Bad Request - Invalid Hostname
HTTP Error 400. The request hostname is invalid.
Can you share a screenshot of this?
This looks like a proxy on your machine doing some blocking of traffic.
I've checked any proxies running with the chrome://net-export/ tool (using this guide), it doesn't mention anything. I don't have any proxies configured in my windows settings either, so I am not sure where it is picking up a proxy from? Any idea or tools I could use?
running netsh winhttp show proxy
in terminal returns:
Current WinHTTP proxy settings:
Direct access (no proxy server).
Do you have fiddler?
I do not, I can install it if it will provide extra info?
Nope I’m just wondering what is returning that bad request page. It’s likely not the dashboard.
So apparently the only thing that fixed this was a windows reinstall. Not really sure what the issue was.
I am sorry we could not get to the bottom of it, but I am glad you are finally unblocked.
Is there an existing issue for this?
Describe the bug
I have used the
.NET Aspire Starter App
template with .NET 8, Configure for HTTPS, Use Redis enabled, and an NUnit Test project to create a .NET Aspire project to create a project from scratch. Haven't changed any code, only pressing the run button in VS. The app fails to run with the following error. This only has an issue on this device, running the same code on a separate device (another PC) works completely fine.There was a similar issue - https://github.com/dotnet/aspire/issues/4437 but the error messages are different. I have downgraded to .NET 8 from .NET 9 but that doesn't seem to have helped.
Expected Behavior
For the Aspire app to run.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version info
dotnet --version 8.0.400
Anything else?
Microsoft Visual Studio Community 2022 Version 17.11.2 VisualStudio.17.Release/17.11.2+35222.181 Microsoft .NET Framework Version 4.8.09032
Windows 11 Pro, Version 23H2