I\'m setting up an ASP.NET Core project on TeamCity. The binaries it builds crash on startup on other machines. The error message shows that it is looking for dlls in paths
After a full search finally found my solution, this was my case: - only happens when run
dotnet publish
so in order to solve this, edit your csproj and make sure to have this configuration.
This apply to webapi netcoreapp 2.0
false
false
this also will solve problems related to
"error CS0246: The type or namespace name 'System' could not be found"
ref.: https://github.com/aspnet/MvcPrecompilation/issues/162 https://github.com/dotnet/dotnet-docker/issues/279