how to deploy mvc core project with database on iis server| iis server enable windows 10(sql server)

Published: 25 February 2023
on channel: MIK technical
3,132
35

how to deploy mvc core project with database on iis server| iis server enable windows 10(sql server)

Open the "Control Panel" and click on "Programs and Features".

Click on "Turn Windows features on or off".

Scroll down the list of features and expand the "Internet Information Services" node.

Check the box next to "Web Management Tools" and "World Wide Web Services".

Expand the "World Wide Web Services" node and check the boxes next to "Common HTTP Features", "Static Content", "Default Document", "Directory Browsing", "HTTP Errors", and "HTTP Redirection". You can also select any additional features you need for your specific use case.

Click on "OK" to save your changes and allow the installation to complete.

Once the installation is complete, open your web browser and navigate to "localhost" to confirm that IIS is running properly. You should see a default IIS page indicating that it's running.

That's it! You have now enabled IIS on your Windows machine and can start using it to host websites and web applications.
Publish your MVC Core project:
a. Right-click on your project in Visual Studio and select "Publish"
b. Choose the "Folder" option and select a folder location to publish your project to.

Create a new website in IIS:
a. Open IIS Manager and select "Sites" from the left-hand menu.
b. Right-click on the "Sites" folder and select "Add Website".
c. Fill in the required fields, including the website name, physical path (pointing to the folder location you published your project to), and the hostname or IP address that the website should listen on.

Create a new application pool:
a. Right-click on "Application Pools" from the left-hand menu in IIS Manager and select "Add Application Pool".
b. Fill in the required fields, including the application pool name and .NET CLR version (should match the version of .NET Core your project is built with).

Configure the website to use the application pool you just created:
a. In IIS Manager, select the website you just created and click on "Basic Settings" from the right-hand menu.
b. Select the application pool you just created from the "Application pool" dropdown.

Configure your database connection string:
a. Open the "appsettings.json" file in your published project folder.
b. Replace the default connection string with the connection string for your database server.

Create the database on the database server:
a. Open SQL Server Management Studio and connect to your database server.
b. Create a new database with the same name as the database specified in your connection string.

Ensure that the user account running the application pool has permission to access the database:
a. In SQL Server Management Studio, right-click on the database and select "Properties".
b. Click on the "Permissions" tab and add the user account running the application pool with "db_owner" or "db_datareader" and "db_datawriter" permissions.

That's it! You should now be able to navigate to the website in a web browser and see your MVC Core project running, with data being retrieved
and stored in your database.

#MVC-core-application
#Sql-server


Watch video how to deploy mvc core project with database on iis server| iis server enable windows 10(sql server) online without registration, duration hours minute second in high quality. This video was added by user MIK technical 25 February 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3,13 once and liked it 3 people.