Other than what @Martin mentioned, in my case the inlineILCompiler value was incorrect. It was missing a \net8.0 from the path.
VS 2022 in my case.