1
votes

This might be a silly question but i'm not too sure on how to do this so apologies. I have a asp.net core application that works and runs when I type in dotnet run in the terminal. I then browse to the url and it displays as expected. But how do I debug on mac visual studio? I have the environment variable added for development. But just expected the web server to open when I press the play button? Is there some a tutorial out there that could explain?

All tutorials are for console apps but not for web projects?

Im using visual studio for mac ? I've add the following code:

            var host = new WebHostBuilder()
            .UseKestrel()
            .UseContentRoot(Directory.GetCurrentDirectory())
            .UseIISIntegration()
            .UseStartup<Startup>()
            .UseUrls("http://localhost:5000")
            .Build();
            host.Run();

But this doesn't fire a browser off?

Is this not how its supposed to work?

Thanks

1
If you create an ASP.NET Core project from within Visual Studio for Mac, you can see it debugs quite well (at least on my machine). So if you do want to know what happens to your project, compare it with the project template. - Lex Li
Yes I tried that but the asp.net core project didnt open a browser on start up, I installed the asp.net core sdk am I supposed to install anything else? - user2956121
Is there a sample project I can download that loads the browser on start up - user2956121
Is the problem that the debugger does not hit breakpoints or just that the browser does not launch? Also which VS Mac version are you using? There is some improved launch url configuration in VS Mac 7.1 which is missing in 7.0. Also check the Application Output window if nothing is happening. - Matt Ward
The browser doesnt load and breakpoints are not hit. I will have to check the VS mac version an get back to you. I will try an update also. - user2956121

1 Answers

0
votes

updated beta release and it fixed the issue