Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio design time issue #3306

Open
HYZ-87 opened this issue Mar 8, 2024 · 4 comments
Open

Visual Studio design time issue #3306

HYZ-87 opened this issue Mar 8, 2024 · 4 comments

Comments

@HYZ-87
Copy link

HYZ-87 commented Mar 8, 2024

Issue details

MethodNotFoundExceptions occur when I tried to open design pages of HUD and FlightData.
image
I tried several ways to solve this, but I still couldn't figure out the reason.

After I updated the version of VS at the laptop that used to work, I finally found out the main reason that causes this situation.

The problem occurred after I updated Visual Studio. The design pages worked fine when I used version 17.8.4 until I updated it to version 17.9.2.

It's either already a potential issue of MP and got exposed due to the bug fix of IDE or it's just the IDE's problem. I can't be certain.

Since I use the community version, there's no way for me to re-install the old version. Has anyone met this issue before? Is there any workaround?

Version

1.3.80 & commit 1fb0fe2

Platform

N/A

Airframe type

N/A

Hardware type

N/A

Logs

N/A

@EosBandi
Copy link
Collaborator

EosBandi commented Mar 8, 2024

It is a Visual Studio issue, 17.9 broke it. Currently no solution yet, only roll back to 17.8.x

@HYZ-87
Copy link
Author

HYZ-87 commented Mar 8, 2024

I see. Thanks for your reply.

@robertlong13
Copy link
Collaborator

robertlong13 commented May 15, 2024

I spent the better part of a day trying to tweak the source to bypass this problem (since I don't think Microsoft is going to fix this anytime soon). Unfortunately, I couldn't get anything to work in a way that could be merged into the repo.

I do, however, have a workaround. Whenever you need to use the designer on FlightData.cs, comment out every line that calls the GdiGraphics constructor in HUD.cs:

graphicsObjectGDIP = new GdiGraphics(Graphics.FromImage(objBitmap));

graphicsObjectGDIP = new GdiGraphics(Graphics.FromImage(objBitmap));

graphicsObjectGDIP = new GdiGraphics(Graphics.FromImage(objBitmap));

Keep a stash of that change handy.

I have no idea why I can't hide these calls behind a design-mode check. It doesn't seem to work. No matter what I do, those lines attempt to call and throw exceptions, without ever hitting any nearby breakpoints when I do design-time debugging. When I comment them out, my breakpoints correctly hit, and my design-mode checks seem to work. It's baffling.

Even wrapping those in try-catch blocks didn't fix it.

@EosBandi
Copy link
Collaborator

EosBandi commented May 15, 2024

Indeed it is very strange bug. I spent quite a time as well to get a workaround, without success. As an icing on the cake, VS 17.9.6 and .7 not only gives an error, but crashes when tries open HUD or FlightData in design mode :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants