question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid assembly after weaving

See original GitHub issue

Not sure if this is an InlineIL.Fody, Fody or Mono.Cecil bug.

Repro: https://github.com/CosmosOS/Cosmos/tree/inline-il

The verification fails, and if I try to load the assembly at runtime it fails with BadImageFormatException. ILSpy loads it correctly.

I tried adding ExcludeAssets="All" here: Cosmos.Core_Asm.csproj#L13, and then used ildasm on both assemblies, and the main difference (ignoring the parts which were not weaved) is the .imagebase, which is 0x00400000 when weaved, and 0x10000000 when not.

Any help would be appreciated.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
SimonCroppcommented, Oct 15, 2018

That was a hack to support a niche edge case I once had. To do with mixing signed and unsigned dlls when using ilmerge. That use case is no longer valid and that property copy could be removed

2reactions
ltrzesniewskicommented, Oct 15, 2018

Yay \o/

Indeed, I can see that Cosmos sets SignAssembly in the “targets” file. Glad you got it figured out.

@SimonCropp why does Fody copy SignAssembly to FodySignAssembly in Fody.targets? The commit that introduces this change only says “perf hacks”…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to compile project due to Fody errors. Nothing with ...
It would seem that your error is actually in finding a class called ModuleWeaver . This class is part of the Fody package....
Read more >
Weaver Exception when load the Fusion Application Loop ...
Hi photon engineers,. I have experience with PUN 1 & 2 and was excited to try Fusion. I decided to reverse engineer the...
Read more >
Building a Fody plugin - pt II - Michiel Sioen
The most important test you can do is verify if the assembly has valid IL code after weaving. This can be done with...
Read more >
Tablet weaving error diagnosis help! The pattern is sort of ...
The pattern is there, it is just jagged because your threading direction is incorrect. Card weaving can be very confusing because some patterns ......
Read more >
Creating a Fody Add-in
IL weaving allows for creating assemblies that violate C# rules. It also means that since you don't have the compiler validating your code, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found