I am following the .NET Core RC2 documentation and most of the information is written considering Visual Studio 2015. However, they also released Visual Studio Code and I can also run applications from the command line.
When I develop a application where I don't have VS2015, I am unable to
- Hookup
launchSettings.json
to my application - Change the launch settings e.g.
Hosting Environment
,launchUrl
, or defaultport 5000
, etc.
How do I set these properties if I am developing without Visual Studio?
It's definitely possible to build a .NET Core app without Visual Studio. Visual Studio Code or the
dotnet
CLI can handle everything you need to do, it's just a little different.As far as I can tell,
launchSettings.json
is Visual Studio-specific. From the documentation:You'll need a different way of setting the options you want:
Binding address and port
This can be configured when you bootstrap your application in
Program.cs
:Hosting environment
From the same docs:
Just set the appropriate environment variable for your platform to "Development", "Staging", "Production", etc. ASP.NET Core will read the value and all the
IHostingEnvironment
logic will work.In Windows, you can set environment variables in the GUI or on the command line:
Launch URL
Visual Studio tries to be helpful by opening the browser automatically for you when you run your application. If you're using
dotnet
, you'll have to do this manually.I haven't tried it, but this plugin for Visual Studio Code might give you that functionality: Visual Studio Chrome Debugger