Recently ASP.NET 5 RC 1 was released and in this post, we shall be taking a look at what’s changed in Visual studio solution explorer and various configuration files, what’s removed and what’s new added.
Also read:
[UPDATE : What’s new in ASP.NET 5 RC 2 or ASP.NET Core 1.0 RC]
Solution Explorer Cleanup
If you have created an ASP.NET 5 beta web application, then you must have noticed many configuration files like bower.json, package.json and hosting.ini were present. And according to ASP.NET team, solution explorer was bit crowded. So these files are by default not present in solution explorer. See below image for comparison.
So does that mean that all these configuration files are gone? The answer is “NO”. They are pretty much available but are hidden by default. Once you press “Show all files”, you will see those files.
Though the bower and package json files are present but hosting.ini file is missing. For those, who don’t know what “hosting.ini” was and why it was included previously? The answer is, hosting.ini file had information about self hosted environment. By default, there were only 2 lines of code.
server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5000
And this file was used by Project.json file’s command section.
"commands": { "web": "Microsoft.AspNet.Hosting --config hosting.ini", "ef": "EntityFramework.Commands" },
I had already posted a detailed overview of Project.json and its various sections. Read “What is Project.json file in ASP.NET 5”.
Since the hosting.ini is removed so now it means that default configuration of the host listening on port 5000 will be used. Now they recommend a hosting.json file be used instead of hosting.ini.
However, I noticed that hosting.json is not present by default. One may need to add it manually.
webroot folder
In the beta versions of ASP.NET 5, the base folder for the static content of an application was defined with the “webroot” configuration property in the project.json file and now this option is moved to hosting.json file .The ASP.NET 5 hosts will no longer honor this configuration parameter in project.json. Previously, the very first line of code Project.json was (as explained here)
"webroot": "wwwroot",
and in the ASP.NET 5 RC1, you won’t find this.
However, the ASP.NET hosts are smart if you do not have a hosting.json file with a webroot parameter configured. If there is a wwwroot folder in the base application folder, it will default that as the webroot of your application. If there is not a wwwroot folder, it will serve the base application folder as the base of static file contents for your web application.
New Bower package manager
Since Bower is already adapted by Visual Studio so now similar to Nuget package manager, you will also see bower package manager to install and manage client side packages.
Since they introduced bower package manager, so all related package which you can install using bower, the nuget will show incompatible and advice you to use bower package manager.
You can read the complete change log here.
That’s all folks. Keep visiting for updates and share this in your network. Please put your thoughts and feedback in comments section.