How to publish nopCommerce 4 to the server?

2 years ago
I downloaded the nopCommerce 4.00 source today, ran it in VS 2017.latest. I setup a database and it went through the install, all looks good with demo data.

Now I want to publish this to my server and run it there as I will when it's time to move from development to production. I used web deploy and published but when it runs I get the install screen again. It doesn't know of the database connection and I'm not sure what else. I looked at the docs and there is no topic that I found on publishing your site.

Please outline what is the proper way to publish to a server and what files need to be uploaded, included, or configured so that I can run development locally and publish and test production when ready to deploy.

Thank you.
2 years ago
hi,
you can publish your nop4 application to iis by following these steps:

1- use vs publish option for nop.web project,
2- create a app pool on iis which is pointed to not managed code,
3- set iis physical path to the root folder (where lots of dll files and also now.web.exe is exist),

there is no more steps for publishing nop4 (.net core) project , but remember to setup .netcore module for server before running your project.
2 years ago
I don't believe this is entirely correct. If you have a working development environment and publish to a server it will not have the database connection so you're met with the setup screen again and can be lead down a dangerous path. I need to know what files I need to manually copy or why some files such as the database config file is not deploying.
2 years ago
i tried this way and successfully done,
remember in nop4 connection string is in datasetting.json file which is in app_data folder.

.net core don't need a webserver BUT(BUT,BUT) we use IIS as a web proxy with lots of options.
just try this way and send your feedback
2 years ago
i tried this way and successfully done,
remember in nop4 connection string is in datasetting.json file which is in app_data folder.

.net core don't need a webserver BUT(BUT,BUT) we use IIS as a web proxy with lots of options.
just try this way and send your feedback
2 years ago
amirkhanjz wrote:
hi,
you can publish your nop4 application to iis by following these steps:

1- use vs publish option for nop.web project,
2- create a app pool on iis which is pointed to not managed code,
3- set iis physical path to the root folder (where lots of dll files and also now.web.exe is exist),

there is no more steps for publishing nop4 (.net core) project , but remember to setup .netcore module for server before running your project.


Hi.
I am having issues getting my site to work via IIS. What do you mean by "remember to setup .netcore module for server before running your project" ? It works when i run Nop.Web.Exe manually and then browse to http://localhost:5000 but when i then add a website in IIS pointing to the root folder (where all the dll's are) i get an internal server error: -


An error occurred while starting the application.
.NET Framework 4.7.26333.0 X86 v4.0.0.0 | Microsoft.AspNetCore.HOsting version 2.0.0-rtm26452 | Microsoft Windows 10.0.16299 | Need help?


I've tried everything to try and get this working. Checked my settings in App_Data\dataSettings.json and the DataConnectionString is working (as proved when manually running Nop.Web.Exe). I've also set stdoutLogEnabled as true within the web.config

Any help would be greatly appreciated.

Running NOP 4.0


Steve
2 years ago
SteveEdwards wrote:
hi,
you can publish your nop4 application to iis by following these steps:

1- use vs publish option for nop.web project,
2- create a app pool on iis which is pointed to not managed code,
3- set iis physical path to the root folder (where lots of dll files and also now.web.exe is exist),

there is no more steps for publishing nop4 (.net core) project , but remember to setup .netcore module for server before running your project.

Hi.
I am having issues getting my site to work via IIS. What do you mean by "remember to setup .netcore module for server before running your project" ? It works when i run Nop.Web.Exe manually and then browse to http://localhost:5000 but when i then add a website in IIS pointing to the root folder (where all the dll's are) i get an internal server error: -


An error occurred while starting the application.
.NET Framework 4.7.26333.0 X86 v4.0.0.0 | Microsoft.AspNetCore.HOsting version 2.0.0-rtm26452 | Microsoft Windows 10.0.16299 | Need help?


I've tried everything to try and get this working. Checked my settings in App_Data\dataSettings.json and the DataConnectionString is working (as proved when manually running Nop.Web.Exe). I've also set stdoutLogEnabled as true within the web.config

Any help would be greatly appreciated.

Running NOP 4.0


Steve


Hello,

If you put actual error from log file which reside in log folder of your deployable code.

It would be benefit for developer to assist you easily and effectively.
2 years ago
Hi there,
Here is the full error log: -


Application startup exception: System.ApplicationException: No database instance
   at Nop.Data.Initializers.CreateTablesIfNotExist`1.InitializeDatabase(TContext context)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
   at System.Data.Entity.Internal.InternalContext.Initialize()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
   at Nop.Services.Tasks.ScheduleTaskService.GetAllTasks(Boolean showHidden)
   at Nop.Services.Tasks.TaskManager.Initialize()
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfigurationRoot configuration)
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
      Application startup exception
System.ApplicationException: No database instance
   at Nop.Data.Initializers.CreateTablesIfNotExist`1.InitializeDatabase(TContext context)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
   at System.Data.Entity.Internal.InternalContext.Initialize()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
   at Nop.Services.Tasks.ScheduleTaskService.GetAllTasks(Boolean showHidden)
   at Nop.Services.Tasks.TaskManager.Initialize()
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfigurationRoot configuration)
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
Hosting environment: Production
Content root path: C:\Build\Wholesale
Now listening on: http://localhost:15672
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://whole.localhost/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 59.364ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://whole.localhost/favicon.ico  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.1984ms 500 text/html; charset=utf-8


Thanks,


Steve
1 year ago
Hi Steve, did you get this solved? I get the same error.
No database Instance....
1 year ago
Nevermind, it was the json file for database connection. the login was set up wrong