R
R
Roman Rakzin2017-04-04 07:34:51
IIS
Roman Rakzin, 2017-04-04 07:34:51

Asp Net Core on IIS only works on localhost. Why?

How to set up IIS+Asp Net Core for Internet access?
At the moment, access is only from localhost - the server gives an error for other requests.
How to run an Aps Net Core project on IIS or Kestrel so that everything works from any computer?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Baidin, 2017-04-04
@zeronice

public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                .UseKestrel()
                .UseContentRoot(Directory.GetCurrentDirectory())
                .UseIISIntegration()
                .UseStartup<Startup>()
                .UseApplicationInsights()
                .UseUrls("http://0.0.0.0:5001")
                .Build();

            host.Run();

You probably have 127.0.0.1 in your URL

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question