VSMac startup experience

wallymwallym USInsider, Beta ✭✭✭
edited December 2016 in Visual Studio

What is supposed to happen when I hit the run button in VSMac when I have an asp.net core application? In Visual Studio Windows, I get a web browser to pop up. The web dev server typically starts up, depending on the exact settings of a project. This is fairly convenient, since I can see things in a web browser, or start up a fiddler session to hit the web services. It would be great if there was a similar startup experience, where a dev server started, loaded up the app in safari, or allowed me to startup fiddler for mac, that would be great. I'm not sure what is possible at this time, but if it is, please point me to the right place.



  • mattwardmattward GBMember Xamurai

    Right now the startup experience for .NET Core applications is a bit limited.

    Currently if you run an ASP.NET Core application with the debugger then the debugger should try to open a browser using whatever url it reads from the dotnet console output. If you run without the debugger then the browser will not be launched.

    VS for Mac does not support Visual Studio's launchSettings.json currently. It may support this in the future. Otherwise you are left with seeing what you can do by configuring/creating a run configuration which are available from the Project Options dialog. Unfortunately testing this it looks like run configurations do not work for a .NET Core project. I suspect the run configuration is being overridden.

    VS for Mac also includes multiprocess debugging support which is new in VS for Mac and Xamarin Studio 6.2 on the alpha channel. So you can launch and debug multiple projects. I believe this was demoed in the Connect 2016 keynote with an iOS app and a .NET Core app were run and being debugged together.

    In theory you could add another say C# console project (not a .NET Core project) and have it run whatever you want. Then add your .NET Core project and the console project to the solution configuration and run both. Unfortunately this does not seem to work that well since the console project will start much faster than the .NET Core project. So if the console app was used to launch a url it would before the .NET Core server had run. Really run configurations or launchSettings.json support needs to be fixed/implemented in VS for Mac so the browser could be launched after the .NET Core project had started up.

    There isn't really an equivalent to IIS Express on the Mac that can run an ASP.NET Core application. The default templates just run it as a console application. There is the Kestrel web server which can be used by an ASP.NET Core project but again you basically run the ASP.NET Core application as a console application which hosts the Kestrel web server.

  • wallymwallym USInsider, Beta ✭✭✭

    Thanks @mattward. I'm not complaining on any of this. I think that these are going to be some of the expectations based on the branding of the product as "Visual Studio." If it were a continuation of Xamarin Studio, I wouldn't have brought it up.

Sign In or Register to comment.