When I run for the first time or publish my project to a web-server via Visual Studio I get sometimes this type of error.
Could not load file or assembly 'Microsoft.Owin, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I can fix it by running the following command in the console and running or publishing again
Update-Package –reinstall Package.Name
I wonder what is the reason for this error and how could I fix it if I am publishing through a pipeline and therefore I cannot run the command in the console when it fails.