Fody / Costura

Embed references as resources
MIT License
2.41k stars 275 forks source link

FileNotFoundException when using referenced assembly in x64 project #870

Closed sasjaq closed 2 months ago

sasjaq commented 1 year ago

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

Component

What component is this issue occurring in? Costura.Fody

Version of Library

5.7.0

Version of OS(s) listed above with issue

w11 (amd64)

Steps to Reproduce

  1. create library project (.net47 or .standard20)
  2. npm google.protobuf (or protobuf-net)
  3. create console project (.net47, x64!)
  4. reference library above
  5. use class from library in code
  6. FileNotFoundException occures

Expected Behavior

when targeting AnyCPU, everythings fine

Actual Behavior

when using class from referenced library, exception throws image

when using code from Costura.AssemblyLoader and manualy load assembly/type/class, it works image

the resource is always present, even compressed, uncompressed, every target combination on project and google.protobuf image

tested on all combinations of targeted architecture, even rebuilding whole google.protobuf class to x64

sasjaq commented 1 year ago

oops, images were mixed, first 2 are from protobuf-net, last one from google.protobuf... but they are same in both projects vice versa

sasjaq commented 1 year ago

just for clarity: SomeUsefullClass is empty class just to can select referenced assambly by type Timestamp is prototype class referencing google.proto/proto-net, can't be used to select assembly, because it ends in FileNotFoundException

Mrgaton commented 1 year ago

Got same error with Interop.WMPLib

Mrgaton commented 1 year ago

when i updated visual studio code the error showed before worked fine :C

GeertvanHorrik commented 2 months ago

Closing due to age of ticket.