I'm using Unity for my IoC container and in my bootstrapper I have this code:
protected override IModuleCatalog CreateModuleCatalog()
{
return Microsoft.Practices.Prism.Modularity.ModuleCatalog.CreateFromXaml(
new Uri("modulecatalog.xaml", UriKind.Relative));
}
and I created an xml file named "modulecatalog.xaml" with this in it:
<?xml version="1.0" encoding="utf-8" ?>
<Modularity:ModuleCatalog
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:Modularity="clr-namespace:Microsoft.Practices.Prism.Modularity;assembly=Microsoft.Practices.Prism">
</Modularity:ModuleCatalog>
And I'm already getting errors in the xaml saying that Microsoft.Practices.Prism.Modularity could not be found and Modularity:ModuleCatalog was not found.
This is extremely frustrating. I have Microsoft.Practices.Prism included in my project. The code in my Bootstrapper compiles so obviously Microsoft.Practices.Prism.Modularity.ModuleCatalog does exist. But even more strangeness, if I change my CreateModuleCatalog function to this:
using Microsoft.Practices.Prism.Modularity;
...
protected override IModuleCatalog CreateModuleCatalog()
{
return ModuleCatalog.CreateFromXaml(
new Uri("modulecatalog.xaml", UriKind.Relative));
}
It says that CreateFromXaml doesn't exist on ModuleCatalog. It has no problem finding ModuleCatalog, but that function apparently does not exist if I don't type out the full namespace every time. WTF is going on?