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

Toggling allowMarshaling breaks the IDE experience till reload #370

Closed
AArnott opened this issue Aug 18, 2021 · 1 comment · Fixed by #421
Closed

Toggling allowMarshaling breaks the IDE experience till reload #370

AArnott opened this issue Aug 18, 2021 · 1 comment · Fixed by #421
Assignees
Labels
bug Something isn't working

Comments

@AArnott
Copy link
Member

AArnott commented Aug 18, 2021

For some reason when I disable allowMarshaling for some reason the source generator stops making its generated outputs visible to Visual Studio. ILSpy on the compiled binary confirms that they were emitted as expected, but they are not visible to the editor, Solution Explorer, or anywhere else in VS. This prevents me from effectively testing CsWin32, because I am getting tons of spurious symbol-not-found errors. This can only be avoided by turning allowMarshalling back on, and then reloading the solution to force VS to re-evaluate the code generators. I don’t know why this would happen, but I do remember it didn’t happen when I tried this library in the past. (I’m running VS 2022 Preview 3.1 and using CsWin32 0.1.506-preview.) Thanks!

Originally posted by @wjk in #328 (comment)

@AArnott AArnott self-assigned this Sep 27, 2021
@AArnott AArnott added the bug Something isn't working label Sep 27, 2021
@AArnott
Copy link
Member Author

AArnott commented Sep 27, 2021

It turns out it isn't toggling allowMarshaling that does it. It's having the JSON file in an unparseable state. If you toggle directly between true and false (by selecting true and pasting in false), it's fine. But if any keystroke leaves the json file in an invalid state, the source generator throws an unhandled exception and then roslyn penalizes it by never invoking it again within that session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant