question

JoeGreen-2947 avatar image
0 Votes"
JoeGreen-2947 asked AgaveJoe edited

Deploying Asp.Net Core Web Application on IIS

I'm trying to deploy my first ever asp.net core MVC web application to production server. It will be hosted on IIS. I published the application to a folder. My publish settings are as follows:
Configuration: Release
Target Framework: net5.0
Deployment Mode: Framework-dependent
Target Runtime: Portable
EF Migrations: Apply the migration on publish is checked.

Visual Studio published application to folder without any errors. I copied it server. I can view the homepage of the application from browser.

I've two questions:

  • I see folders for different languages that contain dll. Since this application is only in English language, do I need to copy all these folders for different languages to server?

  • I was hoping the EF Core will create table on production server but it didn't. I see a folder called EFSQLScripts which contains a SQL script. How do I run this SQL script and where (on development machine or production server)?

Joe



dotnet-aspnet-core-mvcdotnet-aspnet-core-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AgaveJoe avatar image
0 Votes"
AgaveJoe answered AgaveJoe edited

I see folders for different languages that contain dll. Since this application is only in English language, do I need to copy all these folders for different languages to server?

The following SO post explains how to configure the web application to exclude localized assemblies.

.net core build produces localization folders
Resources in .NET apps

I was hoping the EF Core will create table on production server but it didn't. I see a folder called EFSQLScripts which contains a SQL script. How do I run this SQL script and where (on development machine or production server)?

Hoping is not a good approach. It sounds like you want to run pending migrations when that application starts?

ASP.NET Core - Automatic EF Core Migrations to SQL Database on Startup
Applying Migrations


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.