Different js scripts for different ASP.NET core environments· jonhilton.net – Making sense of .NET

When you reference a .js framework or library from your ASP.NET application, it makes sense to use the development version when you’re working on your own machine.

Referencing the development versions brings more useful error messages and integration with the React Developer tools.

But, you wouldn’t want to use these in production for performance reasons.

When you run the site in production, you’d want to reference the minified production versions of the React scripts.

Source: Different js scripts for different ASP.NET core environments· jonhilton.net – Making sense of .NET

Three Steps For Increasing The Security of Your Web Apps – DEV Community 👩‍💻👨‍💻

Source: Three Steps For Increasing The Security of Your Web Apps – DEV Community 👩‍💻👨‍💻

Also have a look at OWASP Top 10 Most Critical Web Application Security Risks: https://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project

 

NLog vs log4net vs Serilog: Compare .NET Logging Frameworks

Logging information in .NET, or really in any production application, is invaluable. In many cases, developers don’t have direct access to the production environment to debug issues. Good quality logs are the difference between solving problems like Sherlock Holmes and stumbling upon solutions like Inspector Jacques Clouseau. As you can imagine, we’re pretty big on logging here at Stackify, and we’ve written quite a few other blog posts on .NET logging frameworks. I’d encourage you to try out the search and read a few of our previous articles.

Source: NLog vs log4net vs Serilog: Compare .NET Logging Frameworks

asp.net mvc – razor views are not giving compile time error – Stack Overflow

Razor views are dynamically compiled by the ASP.NET runtime. If you want your views to be built at compile-time you could add the following option to your .csproj file:
<PropertyGroup>
<MvcBuildViews>true</MvcBuildViews>
</PropertyGroup>

You may take a look at the this article for more details.

Source: asp.net mvc – razor views are not giving compile time error – Stack Overflow

Accessing Azure Web App with FTP

Login to azure portal
https://portal.azure.com/

Goto your web app

Select the tab “Deployment credentials” and set username and password to be used for FTP access. (remember to save).

Goto the “Overview” tab (the top tab)
In the right column you find:

Notice that the user name will be [web app name]\[my username]
That should be all you need to access the web app with ftp or ftps.

 

Import existing EPiServer users into an empty database – EPiServer 7.5

Here is a short guide for importing users from an existing EPiServer site into an empty EPiServer site. And then setup the default user groups and access rights. This is for EPiServer 7.5 using the standard Sql Membership but will probably work fine with newer EPiServer versions as well.

Create empty db

Run deployment center as administrator -> select create Sql db.

Importing users from old/other db:

How to copy table data, see this guide: https://www.sqlshack.com/how-to-copy-tables-from-one-database-to-another-in-sql-server/
The tables are named like: aspnet_Applications

Marked in bold are the tables that was used by my EPiServer 7.5 installation (the other tables where just empty). This is the order used, (see the link above), making sure the Users table is uploaded early on is important.

1. Application
2. Users
3.Membership
4.Paths
5.PersonalizationAllUsers
6.PersonalizationPerUser
7.Profile
8.Roles
9.Events
10.UsersInRoles (watch out for FK constraints to Users and Roles)
11.SchemaVersions (identical between same EPiServer db versions)

Create users and roles from scratch

Override the access protection to EPiServer admin until valid admin user and user groups are created:

Find location elements in web.config and comment out:

<location path="epi">

Comment out the <authorization> element entirely (removes the access protection). The same for location:

<location path="epi/CMS/admin">

Goto http://mysite.local/epi/CMS/Admin/Default.aspx or similar for epi admin area.

Create new roles in admin: (these are EPiServer defaults)
WebEditors
WebAdmins

Add your admin user  to WebEditors and WebAdmins group.

Goto admin “Set access rights”

Set correct access rights for editors and admin groups.
Check lower checkbox to make descendant content inherit the rights.
Also “Everyone” group should have Read access on root and downwards.

Set this in web.config:

<siteSettings pageRootId="1" pageStartId="1"

PagestartId should be root id.

Uncomment the authorization for /epi and /epi/cms/admin (enable the authorization again).

Login with you admin user
Create a start page or import an episerver export xml file.
Run  [mysite.local]/epi/CMS/Admin/IndexContent.aspx to update search index if imported content.

Goto site settings in admin and point out the page as start page. And/or set in web.config

<siteSettings pageRootId="1" pageStartId="4"

(usually becomes 4)

Goto site settings in admin and point out the all site hosts (dev, test, prod etc).
Add more users such as editors and adminstrators that need access to site.