Error: An assembly specified in the application dependencies manifest (WebApplication1.deps.json) was not found: package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.3' path: 'lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll'
Above is an error that ASP.Net Core application cannot report on centos 7
Solution 1 (Failed)
Because only the installed . Net Core runtime without installing ASP.NET Core runtime. Official website link:The hyperlink login is visible.
Try running a command like this:
Then, try restarting the .NET program, but the error is still as above.
Solution 2 (Done)
The problem is that asp.net doesn't release all the packages that the server needs, it thinks the target system has it, but in fact the target system doesn't. Solution:
Add the following line to the csjproj file, as shown in the figure below:
Package and upload to our server, restart the application, and find that it starts normally, as shown in the figure below:
[root@VM_0_9_centos project]# dotnet WebApplication1.dll
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35] No XML encryptor configured. Key {03f25bc0-bd97-441f-a013-72fbe8537c95} may be persisted to storage in unencrypted form.
warn: Microsoft.AspNetCore.Server.Kestrel[0] Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Error -99 EADDRNOTAVAIL address not available'. Hosting environment: Production Content root path: /root/project Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down.
Interface code:
We find that we cannot access normally through the external IP and 5000 ports, we need to install nginx, get a reverse proxy, nginx I have installed, the installation tutorial about nginx is as follows:
nginx.conf is configured as follows:
At this time, we access it through the external IP and port 80, and found that it can be accessed normally! As shown below:
|