Tag Archives: ASP.NET

How to Set File Permissions for ASP.NET Website on Windows

Problem:

  • You have ASP.NET website on Windows.
  • Your website application pool name is mysite.com.
  • Your website physical location is D:\inetpub\wwwroot\mysite.com.
  • Your website physical data location is D:\mysite_data.
  • Your website users cannot upload or modify website files.
  • Your website users cannot upload or modify website data files.

Solution:

1. Open cmd.exe as Administrator and execute the command below.

icacls "D:\inetpub\wwwroot\mysite.com" /grant "IIS AppPool\mysite.com":(OI)(CI)F /T
icacls "D:\mysite_data" /grant "IIS AppPool\mysite.com":(OI)(CI)F /T

This command give full permissions against D:\inetpub\wwwroot\mysite.com  and all sub-directories and files, and against D:\mysite_data  and all sub-directories and files to mysite.com user.

2. Alternatively you can execute the command below.

icacls "D:\inetpub\wwwroot\mysite.com" /grant IIS_IUSRS:F /t
icacls "D:\mysite_data" /grant IIS_IUSRS:F /t

This command give full permissions against D:\inetpub\wwwroot\mysite.com  and all sub-directories and files, and against D:\mysite_data  and all sub-directories and files to IIS_IUSRS group.

mysite.com user is part of the IIS_IUSRS group.

 

How to Select a .NET Framework

Motivation:

You need to select a .NET framework for your new project or for upgrading a legacy system.

However there are too many .NET framework branches so you are not sure which one is suitable with your need.

Guidelines:

You need to review the history of .NET framework and the differences among the various branches that include .NET Framework, ASP.NET Web Forms, ASP.NET MVC, .NET Core and .NET 6.

1. .NET Framework

The main purpose of .NET Framework is for building Windows Forms Applications.

  • .NET Framework 1.0 was released in 2002.
  • .NET Framework 2.0 was released in 2005.
  • .NET Framework 3.0 was released in 2006.
  • .NET Framework 3.5 was released in 2007.
  • .NET Framework 4.0 was released in 2010.
  • .NET Framework 4.5.2 was released in 2014.
  • .NET Framework 4.8.1 (the latest version) was released in 2022.
2. ASP.NET Web Forms

ASP.NET Web Forms was built on top of .NET Framework.

The main purpose of ASP.NET Web Forms is for building ASP.NET Web Forms Applications (multiple page web applications).

3. ASP.NET MVC

ASP.NET Web Forms does not follow MVC architecture pattern. Therefore MS built ASP.NET MVC.

ASP.NET MVC was built on top of .NET.

ASP.NET MVC is open-source software, apart from the ASP.NET Web Forms, which is proprietary.

The main purpose of ASP.NET MVC is for building ASP.NET MVC Applications (multiple page web applications based on MVC architecture pattern).

  • ASP.NET MVC 1.0 was released in 2009 (It was built on top of .NET Framework 3.5).
  • ASP.NET MVC 2.0 was released in 2010 (It was built on top of .NET Framework 4.0).
  • ASP.NET MVC 5 (the latest version) was released in 2022 (It was built on top of .NET Framework 4.8).
4. .NET Core

.NET Framework does not run on Linux or Unix and is proprietary. Therefore MS built .NET Core.

.NET Core runs on Windows, Linux and Unix, and is open-source software.

  • .NET Core 1.0 was released in 2016.
  • .NET Core 3.1 was released in 2019.
  • .NET Core then was renamed to just .NET in 2020 and .NET 5 was released in 2020. The .NET 4 name was not used to avoid name collision with .NET Framework.
  • .NET 8 (the latest LTS version) was released in 2023.

The main purpose of .NET Core or .NET is for building Windows Forms Applications, ASP.NET MVC Applications and Single Page Applications that run on Windows, Linux and Unix.

The ASP.NET Web Forms Application type was removed from .NET Core or .NET.

5. .NET 8

Currently (in 2024) MS supports 2 branches of .NET:

  • .NET Framework 4.8.1 (containing Windows Forms Applications, Web Forms Applications, and ASP.NET MVC Applications) and
  • .NET 8 (containing Windows Forms Applications, ASP.NET MVC Applications and Single Page Applications).

Both .NET Framework 4.8.1 and .NET 8 support building microservices.

6. ASP.NET
  • .NET is a developer platform made up of tools, programming languages, and libraries for building different types of applications.
  • ASP.NET is a .NET web framework. ASP.NET extends the .NET platform with tools and libraries specifically for building web apps. ASP.NET runs only on Windows.
  • ASP.NET Core is the cross-platform version of ASP.NET. ASP.NET Core runs on Windows, Linux, macOS, and Docker.
  • ASP.NET Core MVC is ASP.NET Core with UI components written in HTML, CSS, JavaScript and C#.
  • ASP.NET Core Razor Pages is ASP.NET Core with UI components written in HTML, CSS, JavaScript, Razor markup and C#.
  • ASP.NET Core Blazor is front-end web framework with code written in HTML, Razor markup and C#, and relies on a .NET runtime built with WebAssembly for client-server interactions.
7. Final thoughts

For a new system, you probably should use .NET 8 and ASP.NET Core.

For a legacy system, if you are using ASP.NET Web Forms then you may stick with .NET Framework 4.8.1. Otherwise you may upgrade your system to .NET 8 and ASP.NET Core.

 

 

Topic 8 – Introduction to Web Application Development

Why do I need to learn about web application development?

Desktop applications are very powerful and convenient but their development, deployment and maintenance are daunting.

The reason is that the platform dependency makes it very expensive to create a desktop application working on different versions of different operating systems, such as Windows, Linux and Mac OSX.

Deployment and updates of desktop application typically require high privileges access to a computer machine, causing a problem for companies requiring high security.

Fortunately, you can overcome these limitations by creating a web application running on a browser. To create a web application you need to learn about web application development.

What can I do after finishing learning web application development?

You will be able to create web applications like The BBC News, The WordPress Blog or The White House Website.

This is exactly what I want to learn! What should I do now?

Web application development requires a lot of reading. You have to master networking concepts, HTML, CSS, JavaScript, a programming language and a database management system for web.

First, please read the two books below to get familiar with web application development concepts, and gain hands-on experience with HTML and CSS.

After that,  please read the two books below to learn in-depth about HTML and CSS.

JavaScript is the language for web development because it is implemented in most of the web browsers. Strong knowledge of JavaScript will ease your web development learning very much. Please read the books below to learn about JavaScript.

Single page application is the default front-end choice for most of new web development projects.
Please read the books below to learn how to create a single page application (SPA).

After that, please read the books below to learn how to create micro-frontends.

After that you will have 4 main options. You can choose one of them. We STRONGLY recommend that you choose only ONE option.

You should NOT learn all of them at the beginning. You could save your time by digging into only one option. After mastering the selected technology, you will realize that all of them are very similar in the sense of use.

One note is that although their concepts are similar to one another but it still takes us much time to learn how to apply an approach to real world web application.

When developing a real world web application, you often use only one or two of these 4 approaches. If you cannot make your own selection then we recommend you
– a combination of the first and second option, or
– a combination of the first and third option, or
– a combination of the first and fourth option.

The first option is PHP world.  Please read one of the following books to learn how to create web applications using PHP:

After that, After that, if your projects use WordPress, you may read this book: Brad Williams et al. (2015). Professional WordPress: Design and Development. Wrox.

The second option is ASP.NET. Please read the two books below to learn how to create web applications using ASP.NET:

A complementary part for this option is ASP.NET Web Forms that is a technology that you need to master if you are maintaining a legacy project. Please read this book to learn about ASP.NET Web Forms: Imar Spaanjaars (2014). Beginning ASP.NET 4.5.1 in C# and VB. Wrox.

The third option is Java world. If you are not familiar with Java language then please read the two books below first:

After that, please read one of the following books to learn how to create web applications using Java.

After that, please read this book to learn how to speed up Java web application development using Spring Boot framework: Mark Heckler (2021). Spring Boot – Up and Running – Building Cloud Native Java and Kotlin Applications. O’Reilly Media.

The 4th option is Node.js world. Please read the two books below to learn how to create web applications using Node.js:

There are also several other options that you may consider if you are required to learn them for maintening a project.
These options include:
Ruby on Rails, please read this book: Michael Hartl (2020). The Ruby on Rails Tutorial. Addison-Wesley Professional,
Flask, please read this book: Miguel Grinberg (2018). Flask Web Development: Developing Web Applications with Python. O’Reilly Media,
Django
.

IIf you need to convert a web application from one platform to another or create a web application framework, please read the two books below to learn about the architecture of web applications:

It seems that there are many topics to learn. I am completely new to web programming. What essential knowledge should I focus on to reduce my learning time?

You could focus on these topics first:

  • How to install necessary tools and create a Hello World application.
  • What is the physical structure of a project and how to build it using both IDE and command line?
  • How to deploy an application to a cloud virtual machine and access it via an URL.
  • How to create UIs, transfer data between UIs, compose new UI using existing UIs using frameworks and libraries.
  • How to use built-in or 3rd party libraries to interact with external databases and external services.
  • How to integrate with other web services using standards.

Terminology Review:

  • Networking
  • HTTP
  • HTML
  • Cascading Style Sheets (CSS)
  • CGI
  • Web Applications
  • Multiple Page Application
  • Single-Page Application (SPA)
  • RESTful APIs
  • gRPC APIs
  • GraphQL APIs
  • XML
  • SOAP APIs
  • Web Application Frameworks
  • Portal Frameworks
  • Content Management System (CMS)
  • Payment Gateways

After finishing web application development, please click on Topic 9 – Introduction to Mobile Application Development to continue.