Happily coding and testing this project for a while, and all of a sudden the designer of this Windows Forms page cannot show the form, with the error message below. Still, the project builds and runs OK. I just cannot inspect and improve the GUI of my project.
I tried the answers from similar SO questions, such as deleting bin
and obj
and AppData
folders, close and reopen VS, clean project and rebuilt, but the problem with the Designer remains. Still, the project builds and runs OK.
Please help . . .
Could not load file or assembly System.Dynamic.
File is corrupt. (Exception from HRESULT: 0x8013110E)
It was not possible to just copy and paste the error details, but a screenshot worked. By the way, lately I am also seeing some scary messages in the yellow bars, but always ignored those.
updates:
I checked this SO question on System.Dynamic. I don't use keyword dynamic in my code, I don't even know what that is about. I also do not use Core, I use Windows Forms.
In other SO questions I read about 32/64 bit issues. My projects are set for Any CPU, but for fun I tried to build for 32 bit (x86), and VS crashed. Then I built for 64 bit (x64), then AnyCpu, then 32-bit and that worked. Still funny that VS just crashed (actually, crashed twice) on building for 32 bit. Eventually, building for any bit-option is working now.
CodePudding user response:
From similar questions on SO, I figured that the problem is somewhere in the area of the Visual Studio installation. This is further suggested because the same source code, as archived in SVN, works just fine on my older pc with VS2017. No problem in the Designer of this form.
I could reinstall VS, but I decided to upgrade this VS-2019 to the new VS-2022. Fun because today still 2021, for just a few days.
Running VS-2022, there is no problem with this designer.
Now, running VS-2019, the problem with the designer went away. Perhaps installing a new version of VS cleans up the problem with missing or corrupted assemblies.
The next time I hear about this problem, I would suggest:
Reinstall (or upgrade) Visual Studio
Another reason the upgrade could have solved the problem is that VS 2022 is 64-bit. That eliminates errors like 32 / 64 bit issues.