mattjohnsonpint / TimeZoneNames

Provides a complete source of localized time zone names and abbreviations.
MIT License
199 stars 32 forks source link

TimeZoneData.Load() is not ILmerge friendly, use explicit TimeZoneNames.data.json.gz #77

Closed dzeitlin closed 2 years ago

dzeitlin commented 2 years ago

in TimeZoneData.Load() instead using Stream compressedStream = assembly.GetManifestResourceStream($"{assembly.GetName().Name}.data.json.gz"); please use explicit resource name like this using Stream compressedStream = assembly.GetManifestResourceStream("TimeZoneNames.data.json.gz");

since if one ILmerge your package into some_assemble.dll, the resource name still must be TimeZoneNames.data.json.gz and not some_assemble.data.json.gz

TimeZoneNames v2.0.1 loaded data like this and it worked fine after ILmerge. using Stream stream = typeof(TimeZoneData).Assembly.GetManifestResourceStream("TimeZoneNames.tz.dat");

dzeitlin commented 2 years ago

checked TimeZoneConverter::DataLoader.Populate() looks good and uses fully qualified resource names in calling to GetEmbeddedData()

mattjohnsonpint commented 2 years ago

Thanks. Your proposal sounds reasonable. I'll fix that in the next release. Thanks.