About the plug-in of the. net Core Project released on Linux,. netcore
This article mainly records the issues that the. net Core project encountered when it was released on a Linux server to prevent forgetting
1. the following error is prompted when dotnet xxxxxx. dll is executed in the published file:
An assembly specified in the application dependencies manifest (xxx. deps. json) was not found:
Package: 'swashbuckle. AspNetCore. Swagger ', version: '1. 0.0'
Path: 'lib/netstandard1.6/Swashbuckle. AspNetCore. Swagger. dll'
Solution:
At first, I was able to normally release and modify the project (A compressed file) on Linux, but once again I commissioned my colleague's computer to release the update and found that the project could not be released (B compressed file ). According to the prompts, I checked xxx. deps. json in the and B release packages.
It is found that some sdk versions are different. Some SDK versions in B are 2.0.3 .. Then, in Linux, dotnet -- version found that the current dotnet sdk version is 2.0.0, updated to 2.0.3 (or above) and the program can be released normally.
2. Unable to read local files
Solution: change the reference addresses of all files to relative addresses. (Do not use an absolute address)
There is a supplement to this question. The menu in the project is generated based on reading a local dataClient. json file. Then it can be read normally in windows. It cannot be read when published to Linux. After checking, the file name read by the program is called "dataClient. Json ". The file suffix is case-insensitive, but can be correctly read in windows, so Linux cannot read the file correctly.
Other subsequent supplements ......