Modulecatalog.createfromxaml Issues in Prism 5 + MEF

Source: Internet
Author: User

  protected Override imodulecatalog Createmodulecatalog ()        {            return Microsoft.Practices.Prism.Modularity.ModuleCatalog.CreateFromXaml (thenew Uri ( " Modulecatalog.xaml " , urikind.relative));        }

. NET background, don't say it. Use this code as a starting line. Required when loading parts in bootstrapper.

There are many ways to import modulecatalog, which is always flexible. But this seems to be a bit more cool (no MyApp.exe.config files, also do not write dead in CS code), but how also can not debug. There are several errors in this report:

 is inch The Modulemanager that can retrieve the specified module{"" \f "(hex value 0x0C) is an invalid character   
    is anull in order to initialize the modules.  

The main problems are:

1. The modulename defined in the XAML file does not match the name of the Exportmodule

2. xaml file is not compiled correctly

3. Forget about

Several related codes and settings passed in my project are as follows, Environment Vs2013,prism 5 + MEF,WPF.

Mudulecatalog.xaml:

<modularity:modulecatalog xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="Http://schemas.microsoft.com/winfx/2006/xaml"xmlns:modularity="clr-namespace:microsoft.practices.prism.modularity;assembly=microsoft.practices.prism.composition"> <modularity:moduleinfo ref="File://XianFeng.Client.Modules.Notify.dll"ModuleName="Notifymodule"Initializationmode="whenavailable"Moduletype="XianFeng.Client.Modules.Notify.NotifyModule, XianFeng.Client.Modules.Notify"/></modularity:modulecatalog>

Accordingly, the output file in the XxxNotify.dll NotifyModule.cs:

namespacexianfeng.client.modules.notify{[Moduleexport ("Notifymodule",typeof(Notifymodule))]  Public classNotifymodule:imodule {[Import] PublicIregionmanager Regionmanager;  Public voidInitialize () { This. Regionmanager.registerviewwithregion (Regionnames.notifyregion,typeof(views.notify)); }    }}

Properties of the Modulecatalog.xaml file:

The build operation is resource I have touched it, Bing to some of the information on the old version of it, all wrong, including the Mike Taulty video is not right.

Solve the problem!

Modulecatalog.createfromxaml Issues in Prism 5 + MEF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.