-
Notifications
You must be signed in to change notification settings - Fork 26
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
InvalidProgramException; "Common Language Runtime detected an invalid program." #110
Comments
Could you please run PEVerify on the release mode assembly? |
Getting a bunch of |
The reason for the invalid program exception is that Tracer messes up the IL code when adding trace functionality. PEVerify tool can check if the IL code and the metadata in the assembly are correct and can point out any problem. PEVerify can be run from developer's command prompt if you're using Visual Studio. I need to figure out what construct in your code causes this problem. |
Not finding a lot on PEVerify, so just don't know what is causing all of the |
Another option would be to add VerifyAssembly="true" to the Weavers element in the FodyWeavers.xml. It should run this PE verification after weaving and output the problem. |
Added that and built, and now have a lot of |
Should PEVerify, and Tracer.Serilog for that matter, work for UWP projects? |
Theoretically yes, but I've never tried it. Are you using some special language construct where this error appears? Could you give some minimal reproduction source code so I can debug into it? Anyway I'll create a small UWP project and check if it can be rewritten with tracer. |
No special language construct that I'm aware of. I'll see if I can put something together, but won't have a lot of time this week. Were you able to check Tracer with a small UWP project? |
I created a minimal UWP (just some buttons on a screen) and it works both in debug and release mode. One difference is that I used NLog, not Serilog. I'll check if it makes any difference. |
Running my project in Release mode with Tracer.Serilog.Fody weaved in causes this exception on startup. When I remove the weaver from my FodyWeavers.xml or switch to Debug mode, the app continues running just fine.
The text was updated successfully, but these errors were encountered: