4
When creating a project with the dotnet cli
dotnet new Razor -o Razorpagescontacts
How do I change the environment variable to developer mode when running the application using dotnet run
.
Since in the Startup.cs
I have
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
}
And never gets into the app.UseDeveloperExceptionPage()
using the dotnet run
Using setx did not work using the vscode console. No vscode worked with $Env:ASPNETCORE_ENVIRONMENT = "Development"
– Pablo Tondolo de Vargas
'Cause then it’s powershell
– Leandro Angelo
Yes, you could put in your answer the two options, both for CMD and powershell
– Pablo Tondolo de Vargas