Why is a "You'll need a new app to open this localhost" popup being displayed when debugging my asp.net core 2.0 app in Edge?
Asked Answered
H

3

22

I'm simply entering "MyMessages/Index" after localhost:51531/ and this popup is being displayed. Seems super weird to me but probably something simple.

So I try to navigate to localhost:51531/MyMessages/Index in Edge.

The controller is public class MyMessagesController : Controller

The controller action is just:

public IActionResult Index()
{
    return View();
}

Any idea why this is happening?

This does not happen in IE11

Hawaiian answered 12/3, 2018 at 20:9 Comment(6)
Your question seems missing! What is the controller name?Nardi
Can you show the View name "Index" in "MyMessages" Folder?Nardi
@Coding I cannot take as screenshot since it is on my intranet computer. I can assure you the filepath is ../Views/MyMessages/Index.cshtmlHawaiian
What happens if instead you go to http://localhost:51531/MyMessages/Index? Or http://localhost:51531/MyMessages/?Blatant
Try prepending http:// to that URL. It seems to be parsing localhost as the protocol, which is why it can't find an app to open it with - there is probably no application on your machine registered for the "localhost protocol".Militia
@Blatant That worked :) thanksHawaiian
B
54

The issue is that you have left the scheme off the start of the URL. Some browsers will infer it in certain circumstances, but not all browsers will infer it all the time.

Instead of:

localhost:51531/MyMessages/Index

Try:

http://localhost:51531/MyMessages/Index
Blatant answered 12/3, 2018 at 20:17 Comment(0)
M
6

Try prepending http:// to that URL. Edge seems to be parsing localhost as the URI scheme, which is why Windows can't find an app to open it with - there is probably no application on your machine registered to localhost.

http://localhost:51531/MyMessages/Index

It might seem like a no-brainer to infer http://, but keep in mind that navigating to e.g. file://C:\Users\[Username]\Desktop\document.txt in any web browser will open the file - so when the browser sees something that looks like a URI scheme (like localhost:51531), it does make sense to assume it is one.

The "You'll need a new app to open this" dialog appears when a URL is entered with a scheme that has not been registered to an application. An example of a custom application-specific scheme is the steam://[appid] URL scheme, or the mailto://[address] scheme often used by i.e. Outlook.

(See also What is a URI scheme?)

Militia answered 12/3, 2018 at 20:17 Comment(1)
this worked for me, in my case I was debugging an app and wanted to force a clean load of the page so I just went to address bar and hit [ENTER], didn't work until I manually added the http:// prefix, quite annoying!Nigro
C
1

The simple option of prefixing http seems fine but let's say you hit Ctrl+R (which developers do often) then for weird reason it still pops up applications to open which is annoying. I was able to get it work by adding dns entry (etc/hosts) so that "Edge" must know now what localhost is.

127.0.0.1       localhost
Contingent answered 5/7, 2018 at 4:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.