This post shows you how to develop with efficiency to let the hosting webapp auto recompile upon saving changes to your Razor Class Library in .NET Core 3.0.
Today is the first day of .NET Conf 2019, a slew of videos are coming out to introduce new and exciting technologies in the world of .NET. I watched some of them and I'm really excited about the improvements in Asp.net Core and C#. Here are a couple of interesting things I learned today.
HTTPS has become a basic requirement for a website, I want to show I added a free SSL certificate from Let's Encrypt to my website running on Azure App Service.
If you develop with ASP.NET Core 2.0 or later and you are using TempData, you may run into a 400 error saying your request headers is too long. I've recently encountered this while writing a blog post, it happens when I try to preview the post.
ASP.NET Core 2.2 recently came out and the one thing that caught my attention was the new IIS InProcess Hosting Model. I saw the demo during this week's Community Standup and couldn't help but agree that this could be a big help to development efficiency. As web developers we all do build solution and refresh browsers a lot and any improvement to shorten the time between making a change and seeing that change is welcoming.
Thus far I have a single service in Fan.Blog that handles everything, it's called BlogService. As my code grows this becomes less maintainable, with each new feature I want to add to the blog I have to pile on top of this class, not to mention it's less than ideal if there are others working on the same project and everyone modifies one file. So I wanted to break this giant service class into smaller more focused services.
This week I got my first PR thanks to Flyznex, he helped fix issue #234 Login has a very slow response and along implemented a better way to verify if a string is a valid email. The issue came up when I found that sometime when I login it took a long time.
Fanray uses Serilog and practices Structured Logging. This post explains how it sets up and uses Seq and Structured Logging to easily search through logs, analyze a particular request and more.
If you ever get these CS0246 compiler error saying "type or namespace name could not be found" and pointing to your ".g.cshtml.cs" files of your Asp.net Core application, go check your ".cshtml" files.
Last time I set up Custom Domain and HTTPS for my Azure web app, there remains an issue - my website can be accessed from both the root domain fanray.com and the www.fanray.com subdomain. This is bad for SEO, we need to tell search engine which one we prefer, hence we have to decide on a Preferred Domain either www or non-www. The one you choose will be the one that will be used to index your site's pages and be used for your site in the search results.