I have deployed and nopCommerce v4.60.5 to my Debian 11 server for testing.
When I start the service to handle the application state I get a following error:
root@localhost:/var/www# sudo systemctl status nopCommerce.service
● nopCommerce.service - Example nopCommerce app running on Debian
Loaded: loaded (/etc/systemd/system/nopCommerce.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2024-01-30 11:29:59 UTC; 6s ago
Main PID: 20375 (dotnet)
Tasks: 15 (limit: 1115)
Memory: 276.9M
CPU: 5.813s
CGroup: /system.slice/nopCommerce.service
└─20375 /usr/bin/dotnet /var/www/nopCommerce/Nop.Web.dll
Jan 30 11:29:59 localhost systemd[1]: Started Example nopCommerce app running on Debian.
Jan 30 11:30:03 localhost dotnet[20375]: Nop.Web Error: 0 :
Jan 30 11:30:03 localhost dotnet[20375]: System.IO.FileLoadException: Could not load file or assembly 'System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
at System.Runtime.Loader.AssemblyLoadContext.<LoadFromPath>g____PInvoke|5_0(IntPtr ptrNativeAssemblyBinder, UInt16* ilPath, UInt16* niPath, ObjectHan>
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Nop.Core.Infrastructure.NopEngine.AssemblyResolver.GetAssemblyByFullName(String assemblyFullName)
If I manually start the application it runs without issues.
Here is a snippet.
root@localhost:/var/www/nopCommerce# sudo systemctl stop nopCommerce.service
root@localhost:/var/www/nopCommerce# dotnet Nop.Web.dll
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /var/www/nopCommerce
info: System.Net.Http.HttpClient.default.LogicalHandler[100]
I verified the permissions, and tried reinstalling service but didn't get anywhere.
Please advise.