Possible ASP.NET Core Deployed Folder Structure(With and Without Source)

 

        Introduction:

 

                   When you work with ASP.NET Core application then one thing that may come into your mind is how your folder structure will be look like if you deploy your application with or without source. In this article, I will tell you how your folder structure may look like if you deploy your application with packages or with source. Note that ASP.NET Core still is in pre-release, so things might change when ASP.NET Core will become RTM.  

 

        Description:

 

                    If you deploy your application then your application might be depend or not depend upon 3rd party packages and/or class libraries(Note ASP.NET Core will be package dependent instead of assembly dependent). You might also want to deploy your web application as package instead of deploying the source. In any case you always have a root folder(let's say wwwroot). You will keep your bin, scripts, contents, fonts, etc. folders/files inside the wwwroot folder. Your wwwroot/bin folder should also include Microsoft.AspNet.Loader.IIS.dll(Helios) if you are deploying your app in IIS. In addition to wwwroot root folder, there will be always another root folder(let's say approot) which include packages and src folders. You need to keep the packages inside approot/packages folder and code inside approot/src. Let say you have YourSite.Web project (a web application), YourSite.Data and YourSite.Bussiness projects (class libraries) and Elmah(a third party package). Then the deployed application folder structure with source will look like,

  

        
	wwwroot/bin/Microsoft.AspNet.Loader.IIS.dll
	wwwroot/Contents/site.css
	wwwroot/Contents/.......................................
	........................................................
	wwwroot/Scripts/jquery.js
	wwwroot/Scripts/........................................
	........................................................
	........................................................

	approot/src/YourSite.Web/project.json
	approot/src/YourSite.Web/...............................
	approot/src/YourSite.Data/project.json
	approot/src/YourSite.Data/..............................
	approot/src/YourSite.Bussiness/project.json
	approot/src/YourSite.Bussiness/.........................
	approot/packages/Elmah/{version}/.......................
	........................................................

 

                    If you deploy/pack without source then the deployed folder structure will look like,

 

        
	wwwroot/bin/Microsoft.AspNet.Loader.IIS.dll
	wwwroot/Contents/site.css
	wwwroot/Contents/.......................................
	........................................................
	wwwroot/Scripts/jquery.js
	wwwroot/Scripts/........................................
	........................................................
	........................................................

	approot/packages/YourSite.Web/{version}/................
	approot/packages/YourSite.Data/{version}/...............
	approot/packages/YourSite.Bussiness/{version}/..........
	approot/packages/Elmah/{version}/.......................

                    

                                       

        Summary:

 

                    In this article I showed you how to deploy the ASP.NET Core application using source and packages. You can check this link if you need more information.

No Comments