Despite having been widely accepted as a development platform, ASP.NET was facing a big challenge, in that it was only made for Windows Server and could only be executed on IIS.
IIS is a very popular Web Server (I believe it is the third most popular). IIS supports services like FTP, HTTP, SMTP and enables a Windows machine to manage websites. Because IIS is provided for Windows systems only, therefore, it increases running costs.
Apache is #1 in the race of web server usage. Approx. 48% of websites are hosted on Apache. [Usage of web servers - https://w3techs.com/technologies/overview/web_server/all]
Apache is an open-source web server, freely distributed and a user can edit the code if needed. The main advantage of Apache is lower cost, enhanced security, and flexibility.
To stay competitive, cost-effective, more secure, and to get wide acceptance in the software industry, Microsoft made significant changes in its development platform for ASP.NET. Since the changes are so wide and broad, Microsoft started this with a completely new name .NET Core (Dot Net Core).
In May 2016, Microsoft launched .NET Core 1.0 and currently, 2.0 is available which was launched in Aug 2017.
.NET Core is open source and supports a wide range of platforms, which means it is not limited to Windows and IIS. Development can also be done in Linux and can be executed on Apache etc.
We will discuss what changes have been made in ASP.NET Core from the project structure point of view and we will slightly discuss the execution pattern of ASP.NET Core application in this article.
Project Structure
- wwwroot folder has been added
.NET Core adds wwwroot folder in the project. The term wwwroot is not new but it is still being referred to in Java and IIS. Having a wwwroot folder keeps a clean separation between code files and static files.
Any files which get sent to the browser need to be included in this folder. Like - HTML, CSS, image, and JavaScript etc. Code files should be placed outside of wwwroot. That includes all of C# files and Razor files.
The wwwroot folder represents the actual root of the web app when running on a web server. Static files like config.json, which are not in wwwroot will never be accessible and there is no need to create special rules to block access to sensitive files.
Please note, in order to server static files to a browser, the UseStaticFiles middleware should be enabled in startup.cs* file.
*We will talk about middleware and startup files later.
- Lib folder inside wwwroot
As the name suggests, it is a library folder which holds common library files like jQuery, bootstrap.
Please note, this folder gets updated from bower.json file. So whatever references have been mentioned in bower, those files get updated/created here.
There is no need to check in these files/folders in your code repository as bower maintains these files whenever you restore the package.
- json
Bower is the package manager for the web while NuGet is used to deliver .NET assemblies.
There was always a need and there was no answer so far for what we should do for client-side dependencies. In ASP.NET Core, Bower was able to provide that answer.
Within the .NET ecosystem, it fills the void left by NuGet's inability to deliver static content files. For ASP.NET Core projects, these static files are inherent to client-side libraries like jQuery and Bootstrap. For .NET libraries, you still use NuGet package manager.
Sample Bower.json File
Bower.json file keeps the list of all client side dependencies in a common place, which makes it easier to manage and easier to update (if needed).









Riddhi DevariyaPosted Jun 13, 2018, 10:10 AM
Helpful article. thanks