MapsterMapper / Mapster

A fast, fun and stimulating object to object Mapper
MIT License
4.3k stars 328 forks source link

Mapster.Tool catch ReflectionTypeLoadException #544

Closed EniacMlezi closed 1 year ago

EniacMlezi commented 1 year ago

Was running into Mapster.Tool reflection issues. Docker debug builds (Fastmode enabled, windows build) were succeeding, but release builds (Fastmode disabled, linux build) were failing. Don't know exactly why ReflectionTypeLoadException was occuring when loading certain types from an Assembly, but mr Jon Skeet gave a beautiful (/s) piece of code to filter these exceptions out and continue with all types that loaded successfully: https://stackoverflow.com/a/7889272.

I'm afraid this also might filter out IRegister Types, but I'm not too familiar with the way Assembly.Load() and .GetTypes() work.

Possibly fixes:

368

467

455

513

andrerav commented 1 year ago

Thank you!