You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assembly.Location should return empty string for assemblies loaded from single-file bundle (#39275)
Changes made to PEFile to report empty string for path when it comes directly from the bundle.
I experimented with changing the PEImage m_path to empty string, but way too many things break. It is valid for the m_path to be empty, but we only use it to memory-loaded assemblies where the assembly loaded via PEImage::LoadFlat which does things very differently. The bundle still relies on opening the assembly as a file (file handle and offset).
The end result is that internally the assembly's PEImage has a non-existent m_path (it points to the base directory and the file name of the assembly, but no such file will normally exist). I don't think anything will actually use the path to access the file though.
Also changed how we load CoreLib from bundle. We used to give it path "System.Private.CoreLib.dll" which causes asserts in the runtime in couple of places (the one I hit was when trying to load assembly from memory - it gets CoreLib as its creator and we call GetPath on the creator and then validate the path in debug builds). As far as I can tell this change should not make any observable effect, other than fixing the fact that we expect the m_path of a PEImage to be either empty or absolute path.
0 commit comments