I just recently published my asp.net api with linux and everything worked just fine. Then I decided to make some changes to my code:
- Delete email service that I no longer need. I already ensured that it did not have any reference to others.
I pulled new changes to the hosting server from github and then redeployed with below commands.
cd myapp.Api
sudo dotnet clean
sudo dotnet build --configuration Release
sudo systemctl stop myappweb.com.service
sudo dotnet publish -c release -o /var/www/myappweb.com/api/
Then restart afterward
sudo systemctl restart nginx
sudo systemctl stop myappweb.com.service
sudo systemctl enable myappweb.com.service
sudo systemctl start myappweb.com.service
sudo systemctl status myappweb.com.service
sudo journalctl -fu myappweb.com.service
Then the error occured, even though my local application still working just fine.
* Unhandled exception. System.IO.FileNotFound. Could not load file or assembly 'FluentAssertions, Version=5.10.3.0, Culture=neutral, PublicKeyToken=22f2441a05b241b4a'. The system cannot find the file specified.*
I already checked the version, its the same. And right away I reverted the commit on github and tried to redeploy but it still generated the same error.
I would appreciate any help or suggestions on what the real problem is !!