I'm doing a project in Prism WPF, and I want to use fody.costura to have only one executable and a folder of Prism modules, when i Add costura to the project and start the application prism does not find the modules in the directory: .\Modules I already tried all of the other methods of Initialization of modules, but the bootstrapper doesnt find them , it is important to say that all the dependencies of my modules are included in the initial bootstrap project.
Does anyone know how to solve the loading problem of modules in prism, when using fody.costura?
--------------------edit-------------------------
I am adding the code:
protected override DependencyObject CreateShell()
{
return Container.Resolve<MainWindow>();
}
protected override void InitializeShell()
{
Application.Current.MainWindow.Show();
}
protected override IModuleCatalog CreateModuleCatalog()
{
return new DirectoryModuleCatalog() { ModulePath = @".\Modules" };
}
protected override void ConfigureModuleCatalog()
{
var moduleCatalog = (ModuleCatalog)ModuleCatalog;
}
And the Error I got is: The lenght of the string cannot be zero.
StackTrace " en System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)\r\n en System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)\r\n en System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)\r\n en System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)\r\n en System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence)\r\n en System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)\r\n en System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)\r\n en System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)\r\n en Prism.Modularity.DirectoryModuleCatalog.InnerLoad()\r\n en Prism.Modularity.ModuleCatalog.Initialize()\r\n en Prism.Modularity.ModuleManager.Run()\r\n en Prism.Unity.UnityBootstrapper.InitializeModules()\r\n en Prism.Unity.UnityBootstrapper.Run(Boolean runWithDefaultConfiguration)\r\n en Prism.Bootstrapper.Run()\r\n en NFE2018.App.OnStartup(StartupEventArgs e) en C:\\Users\\arman\\documents\\visual studio 2017\\Projects\\NFE2018\\NFE2018\\App.xaml.cs:línea 33\r\n en System.Windows.Application.<.ctor>b__1_0(Object unused)\r\n en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)\r\n en System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)" string
Exception appears here:
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var bootstrapper = new Bootstrapper();
bootstrapper.Run(); <-------- Here
}