Is there an SMTPAppenter for log4net in .NetCore yet? Alternatives? - log4net-appender

Is there an SMTPAppender for log4net in.NetCore yet?
I can find a post from 2017 saying it's not in yet,
Log4Net SmtpAppender not working in .netCore
but that's been quite a while. There are so many .net SMTPAppender posts that I'm not sure if it's lost in the noise, or doesn't actually exist.
If it doesn't exist, what is the best equivalent?
I'm on .netcore 3.1 Vs2019, WebApi if it matters.

Related

How do I troubleshoot auto-refresh failing silently in ASP.NET Core 5?

I read about the Auto-refresh capability introduced in ASP.NET Core 5 with .NET 5. I upgraded my Blazor site to .NET 5, and thought it would just work, but it doesn't seem to be working for me.
I used to use Westwind.AspNetCore.LiveReload, but I have removed it to try this out.
When I make a change, the app rebuilds and restarts web server for me, but the browser doesn't refresh. This is a project I upgraded from .NET Core 3.1. Is there anything that needs to be done in startup.cs to enable this? What else could be interfering? How can I troubleshoot?
You can livereload page using methods mentioned in that question answers
.NET Core MVC Page Not Refreshing After Changes

What is the best way to use HTTPS in asp .net core?

I have published an asp.net core project(a website which made by asp.net core MVC) on a server(windows server 2018) and it works well for a long time.
And also, it used the HTTP all the time. As we know, now google suggest upgrade HTTP to HTTPS for more safely. So I wanna to upgrade it also.
I have applied for an SSL certificate yet and I found several ways to use HTTPS in asp.net core, such as:
The official way by adding so many codes in code-behind:
https://learn.microsoft.com/en-us/aspnet/core/security/enforcing-ssl?view=aspnetcore-2.2&tabs=visual-studio
By using PowerShell and edit some code in code-behind:
https://asp.net-hacker.rocks/2018/07/05/aspnetcore-ssl.html
By using some Nuget Package:
https://dzone.com/articles/enforce-ssl-and-use-hsts-in-net-core20-net-core-se
Just configure it in visual studio:
https://wildermuth.com/2016/10/26/Testing-SSL-in-ASP-NET-Core
But I tried all the way above and failed. Now I am crazy because there are so many ways and I don't know which one is right.
What's more, if all ways above can achieve it, then what's the difference between them and what's the advantage and disadvantage of them?
I am a beginner in web development and I have never been in touch with the HTTPS.
Would you please help me? Thank you.

LinkedIn External Login in ASP.NET Core 2.0

I need to implement external logins and had no problem with Facebook and Google since they are supported but I'm stuck at LinkedIn. I am not exactly a beginner but I'm not very experienced at this either. Prior to this post I viewed a thousand explanations and most of them were vague, others just didn't work and others were explained for advanced people.
What I've tried:
-using cookies in the Configure method, but the methods were deprecated (I figured they were not for the 2.0 version). I also tried app.UseLinkedInAuthentication(...) from Microsoft.AspNetCore.Authentication.LinkedIn to no success.
-writing a service in ConfigureServices (but I didn't get it to work, I assume this is where I need to do it). I also tried this but they were talking like they knew what they were doing.
So to keep this simple, I made a default MVC ASP.NET Core 2.0 application in Visual Studio 2017. All I need to do is write stuff in Startup.cs, so my question is, what is it that I have to write and why? Thank you very much in advance.
PS: I would appreciate an explanation in the comment, if it's a link I probably already visited it :)
There is AspNet.Security.OAuth.Providers repo that provides a collection of security middleware to support social authentication providers.
Corresponding releases can be found using this link: https://www.nuget.org/profiles/aspnet-contrib (all packages that start from AspNet.Security.OAuth)
Unfortunately, the current master branch is only for ASP.NET Core 1.0 and so nuget packages like package for LinkedIn were published only for that version, but you may clone the repo and switch to experimental branch that is an on-going port to ASP.NET Core 2.0.
Look into this github issue if you need the current status of porting.
By the way, according to this github issue, the LinkedIn authentication provider has been ported already.

How to enable trace.axd in ASP.NET core?

Our app is based on ASP.NET Core 2.0. It works fine in development environment but we see an oauth error when published to production.
All the documentation on asp.net core seems to point to using ILoggingxxx interfaces. The examples I found typically call logging.AddConsole() method so that the log lines can be viewed in VIsual Studio debug window. I am wondering if the good old trace.axd is still available under asp.net core. If so, I would appreciate the steps to enable tracing. Regards.
trace.axd is exclusive to applications based on .NET Framework and ASP.NET 4.x. It is not available in ASP.NET Core applications at all.

Migrating from OWIN to ASP.NET Core

When moving from OWIN to ASP.NET Core, I've found a bit of information about dependencies to migration, but I've not found information about these other topics:
The middle-ware pipeline. How is this different, or not?
The DelegatingHandler pipeline (e.g. Web API). How is this different, or not?
The startup.cs file. How is this different?
In short, it would be great to know what are the primary hot-spots that would need my attention, in order to move from OWIN to ASP.NET Core.
As a first example - ASP.NET Core does not appear to have HttpConfiguration. There are myriads of example plugins and services that assume its existence. I'd like to infer how to translate instructions for HttpConfiguration into whatever approach ASP.NET Core expects.
As another example, the Swashbuckle documentation gives instructions for setup with OWIN, but those instructions don't work with ASP.NET Core. If I understood the primary differences from OWIN, it would be easier to "guesstimate" how to install Swashbuckle into ASP.NET Core.
Note: Swashbuckle also gives instructions for self-hosted apps. That confuses me because I think of OWIN (vis-a-vis Katana) as being self-hosted already, and so it sounds redundant to me. But I don't think this is related to the present question.
My question has used Swashbuckle as an example, but I am not asking about Swashbuckle specifically.
Update
I've discovered that much of the information I'm looking for is in the article Transitioning from Web API 2 to ASP.NET MVC 6.
Middleware is quite similar between Katana and Core but you use HttpContext instead of IOwinContext.
Startup.cs is similar but there's much more DI support.
WebApi has been merged into MVC
DelegatingHandler is gone, use middleware instead.
HttpConfiguration has been split up into Routing and MvcOptions.
Also https://devblogs.microsoft.com/aspnet/katana-asp-net-5-and-bridging-the-gap/
I think you can start here. It's an entire chapter about OWIN with ASP.NET Core. Hope this helps.