How to Publish,Deploy and Host ASP .NET Core Application on IIS||Deploy and Host ASP.NET CORE on IIS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to mcro code if you're new to this channel consider subscribing so today we going to learn about how to deploy and host a speed netore application on Windows is or server so I'm going to demonstrate this using my machine so to start with we are going to create a simple project an asp MVC project so asp.net called web app MVC then I'm going to call this uh sample is demo so we going to host this project on our is and guide you through how we can do that so I'm going to use net 8 individual accounts then create so my project has created so you can see here I have my project so we have the areas folder I have my pages folder then controllers I have my controller I have my my data application DB context models I've used uh app settings. Json and even the program. Cs file so if I just launch this project so let me just clean this project rebuild so let's rebuild so if I just launch my project let's see how it it looks like before we actually deploy so this is how the project looks looks like so we have a register link so you can register an account and we have the login section so you can actually change the the title of our project so come to share layout then layout so I'm going to change this title then we can call it something else so where is our title so let's let's call these uh macro code demo so I want us to change this say macro code demo so for this I want us to relaunch and see how it looks like so I want us to deploy this project on our is so the same approach I'm following you can actually do it on a server but I'm doing it on my machine so you can see this mcro code demo register and even a login so after we have done with that so I want us now to deploy this app so I want us now to deploy this app on our machine but before that before you actually deploy there's something we need so remember we build our application on net 8 so before we actually deploy the app we need the hosting bundle so we need to actually install this on our server so that we can actually uh host the application on our is so this is actually required for is support so I'm going to download hosting bundle for Windows so if you click that you should be able to download this so let me just click let me just click it so my I my hosting bundle is downloading then I'll be able to install it so if you want to do that please install so as you can see espet net costing bundle contains everything you need to run existing web app or server apps so the bundle includes the net run time the sp. net core runtime and if install on a machine with is it will also add the sp. net core is module so if you only want the net or sp. net cor time you will find these under this uh sp. net 8.0 downloads so for us we are interested with a Windows hosting bundle install so I'm going to download that then install so once this is downloaded so we can actually install this so I agree to the terms then I'm going to install this so let's install it's installing there you go so this is actually successfully installed so after that I want us to do something so after we after we've installed the net cor hosting bundle I want us to publish this application so we going to stop this and to publish our app I'm going to right click the project then do publishing for those who are using Windows so we are demonstrating this using Windows then if you click publish it will give you this dialogue so you can actually publish to a do do doer container registry folder FTP web server or import profile but I'm going to show you how you can publish this to a folder so I'll choose folder then next then we can actually choose the directory where these is are going to be uh published so I can locate this on my machine so you can do the same for your machine so locate this on a certain directory somewhere so I can actually create cre a folder folder and do that so after after I've given the directory so I can actually publish it so you're able to see that you are you'll be able to configure the profile so the settings the Target location this is the location you able to delete existing file so you can actually as well edit this settings so you can edit so if you click edit you're able to get this profile so we are we our deployment mode is on release then we are targeting net 8.0 deployment mode is actually uh framework dependent or self contained so you can actually have these as a self contain or framework dependent now let's just do framework dependent then run time uh we can do portal or we can do wi x64 so I'm going to do that then I'm going to do framework dependent then file public publishing options you can actually delete all the existing files prior to publishing this is when we'll be doing redeployment republishing so you can actually do that then it will actually give you the connection the database connection that you are using on your on your application so you can say use this uh connection string at run time then you can also apply if you want to use this application apply this migration on publishing so but for now I want us to untake that then we can actually publish this so we are going to publish this using a deployment mode and the configuration is on release then save those as settings so you'll be able to see this is now saved we have the target folder the delete existing files is not true the configuration is released the target framework and the target run time so if we just publish this it will actually publish our application in release mode to the specific folder that we actually specified so let's see so if you do that you can see you get now the success message and when you go to the folder that you choose mine is this one so you can see this is the file so these are the files that has been published we have the app settings and the app settings development. Json so I want us to do something I want us to copy all of these files but before we do something with those files I want us to go to is then under sites I want us to add a new site then we are going to say this is student site so you can call this student site then the physical path where our files will be hosted I want us to go to local dis C you can actually have this on a different uh folder but I'm going to local dis C then inet PAB then I'm going to ww root then I'm going to create a folder here so I'm going to call that I'm going to call that students site I'm going to call that students so let me call that students then that will be my physical path then I'm going to have this I can specify the port 7074 then I click okay so I'll now have my site here so for me to go to the physical path I can actually come on top here and then do explore then it will actually open my path so if I come here now I can copy the files that we we published to this directory so I'm copying all the files that we publish to this folder so you can see this is my folder so you can see this is my folder local this in PB ww root and students then all the files that we publish is actually on this folder so if you go to our is and try to restart then if you come down here you'll see there something called browse then we can see our Port 7070 so you can give it you can give the port the port of your choice so I've just done this for my case so if I just click browse you can see it is asking me to give a username and password so there's something that is uh giving so it is actually unauthorized so authentication mode so let's go to our is so let's check on double click on student site then check on the authentication so on authentication you can see the basic authentication is enabled so I want us to enable this Windows authentication and we can actually disable this one so we enable Windows authentication and we disable basic authentication so the reason as to why we we are being asked for username and password is because we require basic Authentication rather than Windows authentication so to to change that we can enable it here and change it so you can see now our application is running on a local host 7070 and it's macro code demo then uh you can see we can actually do anything with our with our application so you can see now how so you can see now application is running on Local Host 770 uh demo we can click on register log for got password go back here login then we can say register user can also say resend email confirmation you can also go back to home so assuming we made some changes so if we go back to our application and go back to home and we do here we say welcome to mro code so we've actually made some changes to our app so we want these changes to take effect on our application so you can see currently this is what is there so to publish we need to republish our application so we'll go to sample then publish then you'll see all the settings that we had configured is there so this is my folder this is the delete existing files I've actually renamed this folder so for those who are following then Target framework. net 8 configuration is released then Target runtime is Windows x64 so I can actually publish so I just click that but you can also choose a new profile and create a new profile so but I'm reusing this so once that is published we can go to our folder so the the folder that we so this is the folder so instead of copying so instead of copying these all of these files I can copy some specific files so you can actually do paral partial deployment so instead of copying all these files we can actually copy only the DLS so I'm I'm going to copy the DLS files only and to do that I'm I I'll come to my project then I'll actually copy the sample is demo dll so if I just copy this single file here then go to my is then do expl low it will take me to my root directory where I have my project then I can actually replace this so I'm copying only this sample is demo so if I just copy so something will not work because I need to stop my project so I'll actually restart and stop it before deploying then I'll go back here then if I try it it will actually copy so if I go back to my is start my project restart it and browse again I'll be able to see that my project has now changed welcome to macro code and it's running on the same port local host. 7070 so the trick is we've just copied a single file when we change our project so when we are redeploying the project unless you've made some major changes or update some new get packages you can only copy the specific d that you have affected so for mine I only change the The View and it is within this DL so I've just copy this instead of actually copying all of these files so and that is it on how you can actually deploy a simple. net cor project on is so if you like the video comment down below and see you in our next video bye [Music] oh
Info
Channel: Macro Code
Views: 4,905
Rating: undefined out of 5
Keywords: AmigosCode, .NETCORE, Sundeep, Saradhi, freecodeCamp, ProgrammingWithMosh, MikeDane, IamTimCorey, TeddySmith, FireShip, DaniKrossing, Stefan Mischook, ASP.NET CORE, Coder Foundry, Jose Montemagno, .NET 7, Nick, Nickchapsas, Jake Wright, Keep On Coding, QuestPond, Amigos, Developer Filip, TechWorld With Nana, Techworld, GotoConferences, CRUD, ASP.NETCORE, SQL, SERVER, BoostMyTool, API, Code with Julian, MinimalAPI, FLAVOUR, BroCode, CodeWithBen, Deploy, IIS, Windows IIS, dotnet, HostIIS, DeployIIS, ASP.NET CORE IIS
Id: g_RccWGjLhU
Channel Id: undefined
Length: 15min 45sec (945 seconds)
Published: Mon Jan 08 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.