Lance Larsen - .NET Architect Madison Wisconsin

All posts in Tips

imageGreetings my Geeks – we have a lot of awesome ASP.NET Core 2.0 news coming out lately…

As always, sharing is caring – so here you go.

Today – after publishing to Azure – ran the default “Register” user page – and got the error message…

Swapping to Development environment will display more detailed information about the error that occurred.

Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.

imageSo did a search for “ASPNETCORE_ENVIRONMENT” – and found the only references in my project were already set to “Development”…  so that wasn’t it…

imageEventually found a clue that that mentioned Azure App Settings – and yup – that’s where this needs to be set.

So click on your Web App –> Applications Settings –> go down to the “App Settings” section and add the “ASPNETCORE_ENVIRONMENT” and “Development” as displayed in the screen shot.

Now you’ll get the error messages as if you were running it locally – and that should help you resolve your issues.

REMEMBER – before you go to use this in production – revert that change.  Don’t want the bad guys to be able to see any error details.

Good coding!



Surface Pro 3

Firstly, love my new Surface Pro 3 – finally the tablet PC I’ve been waiting for!  Have all of my development tools; Visual Studio 2013, SQL 2014, etc loaded up and running very quickly.

As a developer in Visual Studio however I need to use the function keys more than using the shortcuts across the top of the keyboard – and didn’t want to always have to press “Fn” + “F5” – so looked for a solution and found one and wanted to share…

Function Key Lock Tip: Press “Fn” + “Caps” and now all the Fn keys work without having to hold down the “Fn” key! w00t