I made a ASP.NET Core webapp and wish to deploy it to my raspberry pi and host it using NGINX. Am following the guide provided by Microsoft: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-2.2
and i am stuck at testing the app. This is what I did:
On my Windows PC in which I developed the webapp on, i went to the solution path:
E:\testapp
and ran the command on cmd:
dotnet publish --configuration Release
No errors was found and it was shown that my project L07 that was part of the testapp solution was successful.
But when i tried to test the app by running:
dotnet L07.Views.dll
it returned a fatal error:
A fatal error was encountered. The library 'hostpolicy.dll' required
to execute the application was not found in 'E:\testapp\L07\bin\Release\net461\publish\'.
Failed to run as a self-contained app. If this should be a framework-dependent app,
add the E:\testapp\L07\bin\Release\net461\publish\L07.Views.runtimeconfig.json
file specifying the appropriate framework.
. I ignored that and transferred the entire E:\testapp\L07\bin\Release\net461\publish files to my raspberry pi and ran the same dotnet command and it gave me another fatal error which is:
A fatal error occurred, the folder [/usr/local/bin/host/fxr] does not exist
I feel that I am doing many wrong things here, anyone able to advise accordingly, as detailed as possible.
p/s not sure im i am posting this in the correct site
net461appear in your error message? `E:\testapp\L07\bin\Release\net461\publish`RuntimeIdentifiers/RuntimeIdentifierentries. Without it, its not self-contained. Also you can't self-contain .NET Framework targets, just .NET Core ones