Bad IL format. The format of the file is invalid. Can't publish project

I tried both solutions mentioned on the post, but still the same problem: