Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DirectoryModuleCatalog - problem with diacritics since 6.3 #1013

Closed
tNRevan opened this issue Apr 10, 2017 · 4 comments
Closed

DirectoryModuleCatalog - problem with diacritics since 6.3 #1013

tNRevan opened this issue Apr 10, 2017 · 4 comments

Comments

@tNRevan
Copy link

tNRevan commented Apr 10, 2017

Hi,

since upgrading to Prism 6.3 from 6.2 I am experiencing a problem with DirectoryModuleCatalog when loading from a path containing diacritics. When I inspect the ModuleInfo.Ref, it contains "file:///D:/Pr%C3%A1ce/Module.dll". In 6.2, it was "file:///D:/Práce/Module.dll". So I can see the catalog is newly URL-encoding the path. But, then it fails during loading of the module:

System.IO.FileNotFoundException: Could not load file or assembly 'Module.dll' or one of its dependencies. Systém nemůže nalézt uvedenou cestu. File name: 'Module.dll' ---> System.IO.DirectoryNotFoundException: Systém nemůže nalézt uvedenou cestu. (Exception from HRESULT: 0x80070003) at System.Reflection.AssemblyName.nGetFileInformation(String s) at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile) at System.ComponentModel.Composition.Hosting.AssemblyCatalog.LoadAssembly(String codeBase) at System.ComponentModel.Composition.Hosting.AssemblyCatalog..ctor(String codeBase) at Prism.Mef.Modularity.MefFileModuleTypeLoader.LoadModuleType(ModuleInfo moduleInfo)
(the localized code means 'System cannot find the given path')

After inspecting the MefFileModuleTypeLoader it looks like it uses the encoded path to load the module. I use Prism.Core, Prism.Mef and Prism.WPF packages.

@dvorn
Copy link
Contributor

dvorn commented Apr 10, 2017

Did not expect that container adapter (MEF) contains its own copy of FileModuleTypeLoader.

MEF is unsupported anyway. :)

Fixed in #1014

@dvorn
Copy link
Contributor

dvorn commented Apr 10, 2017

Problem with FileModuleTypeLoader was that it was inconsistent: to determine the module size it used module path verbatim, but to actually load the module it constructed an uri from module path.

Now if module path is not escaped but contains special characters (e.g. #) the uri part breaks. But if the path is escaped then the verbatim part breaks.

@brianlagunas
Copy link
Member

Thanks @dvorn for the fix.

@tNRevan I want to reiterate what @dvorn mentioned. MEF is no longer an officially supported container. It's mainly here for backwards compatibility.

@lock
Copy link

lock bot commented Jan 30, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants