<##[error].nuget\packages\refit\5.1.67\build\netstandard2.0\refit.targets(33,5): Error : Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified>>
Working properly in local machine, the error comes when building the app in azure devops.
Tried adding nuget package for System.Runtime.CompilerServices.Unsafe expilicitly but not working.
@AnjaliSahu51 any resolution details? we're having the same issue, both in azure devops and building locally
@cotyhamilton My team just ran into this same issue when using Refit. Not a definitive fix, but here's what worked for us: Delete entire .nuget folder to clear package cache, commented out code from refit.target file, re-downloaded packages and run it... it gave me a different error, then I un-comment same code from refit.target file and it worked.
@jdevincework when I was working with this I discovered some ways to get it to build, similar to yours, but it would never build from a clean state so our cicd efforts were blown. I think we ended up downgrading the version of this one
@cotyhamilton @jdevincework @AnjaliSahu51 ran into this on a project where it would build locally fine, but not on devops. Tried all sorts of binding redirect variations to no avail. Finally, thought to check the task group on DevOps and noticed the build task was still using VS2017. Locally, we're working with VS2019. Updated the task in DevOps to use VS2019 and problem solved!

Hope that helps someone!
Most helpful comment
@cotyhamilton @jdevincework @AnjaliSahu51 ran into this on a project where it would build locally fine, but not on devops. Tried all sorts of binding redirect variations to no avail. Finally, thought to check the task group on DevOps and noticed the build task was still using VS2017. Locally, we're working with VS2019. Updated the task in DevOps to use VS2019 and problem solved!
Hope that helps someone!