Should loading OnDemand Prism modules work in an OOB environment? If so, I cannot get it to work. Everything currently works in the browser without any problems. In particular, I: register my modules in code:
protected override IModuleCatalog GetModuleCatalog() {
var catalog = new ModuleCatalog();
Uri source;
if( Application.Current.IsRunningOutOfBrowser ) {
source = IsolatedStorageSettings.ApplicationSettings[SOURCEURI] as Uri;
}
else {
var src = Application.Current.Host.Source.ToString();
src = src.Substring( 0, src.LastIndexOf( '/' ) + 1 );
source = new Uri( src );
IsolatedStorageSettings.ApplicationSettings[SOURCEURI] = source;
IsolatedStorageSettings.ApplicationSettings.Save();
}
if( source != null ) {
var mod2 = new ModuleInfo { InitializationMode = InitializationMode.OnDemand,
ModuleName = ModuleNames.mod2,
ModuleType = "mod2.Module, mod2.Directory, '1.0.0.0', Culture=neutral, PublicKeyToken=null" ),
Ref = ( new Uri( source, "mod2.xap" )).AbsoluteUri };
catalog.AddModule( mod2 );
}
Application.Current.RootVisual = new Grid();
return ( catalog );
}
later request for loadable module:
mModuleManager.LoadModule( ModuleNames.mod2 );
and wait for the response to the event published during the initialization of this loaded module.
The module never loads, and when the application is running under the debugger, a message box appears saying that the web server returned a "not found" error. I can take the requesting url for the module and enter it in Firefox and load the module without problems.
, , , . , , - Jeremy Likeness, MEF, .
localhost ( , , ). clientaccesspolicy.xml - , .
:
WebRequest.RegisterPrefix( Current.Host.Source.GetComponents( UriComponents.SchemeAndServer, UriFormat.UriEscaped ), WebRequestCreator.ClientHttp );
:
xaps - - xap? appmanifest.xml -??
, application.xap, xaps ?