In a MVC2 project I moved a file from App_code to Content folder and compiled it. Then move it back again to App_Code and then changed its Build Action to \"Compile\". Now I
I fixed this by removing one of the unneeded NuGet packaged referenced in the dll files causing this conflict.
So in this case I had both ZXing.Net and ZXing.Net.Mobile installed. Since I was creating a mobile app in Xamarin Forms, removing the ZXing.Net NuGet package resolved this.
Be sure to check and make sure you don't have redundant NuGet packages for different frameworks, i.e. ASP.Net versus Xamarin.