Я разрабатываю образец, используя silverlight5 и prism4.Когда я запускаю свое приложение, я получаю следующее исключение
"Нарушение правил безопасности наследования при переопределении члена: 'System.Exception.get_InnerException ()'. Доступность безопасности переопределяющего метода должна совпадать с доступностью безопасности методапереопределяется. "
и трассировка стека выглядит следующим образом
в System.ComponentModel.Composition.Hosting.ImportEngine.PartManager.TryOnComposed () в System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine (PartManager partManager, ComposablePart part) в System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports (PartManager partManager, ComposablePart, булевый компонент..Composition.Hosting.ComposablePartExportProvider. <> C_ DisplayClass2.b _0 () в System.ComponentModel.Composition.Hosting.CompositionServices.TryInvoke (Действие действия) в System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose (пакет CompositionBatch) в System.ComponentModel.Composition.Hosting.CompositionContainer.Compose (пакет CompositionBatch) в System.ComponentModelServiceTodelt(Контейнер CompositionContainer, T exportedValue) в Microsoft.Practices.Prism.MefExtensions.MefBootstrapper.RegisterBootstrapperProvidedTypes () в Microsoft.Practices.Prism.MefExtensions.MefBootstrapper.ConfigureContainer ().) в Microsoft.Practices.Prism.Bootstrapper.Run () в Honeywell.CIU888.Shell.App.Application_Startup (отправитель объекта, StartupEventArgs e) в MS.Internal.CoreInvokeHandler.InvokeEventHandler (UInt32 typeIndex, объектный объект-делегат делегата, делегат-обработчик-делегат)) в MS.Internal.JoltHelper.FireEvent (IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 activalArgsTypeIndex, String eventName, UInt32 flags)
Кто-нибудь поможет в этом.
Ниже приведен мой код,
BootStrapper.cs
public class BootStrapper : MefBootstrapper
{
protected override void InitializeShell()
{
base.InitializeShell();
Application.Current.RootVisual = (UIElement)Shell;
}
protected override DependencyObject CreateShell()
{
return Container.GetExportedValue<MainPage>();
}
protected override void ConfigureAggregateCatalog()
{
base.ConfigureAggregateCatalog();
AggregateCatalog.Catalogs.Add(new AssemblyCatalog(this.GetType().Assembly));
}
protected override IModuleCatalog CreateModuleCatalog()
{
}
}
приложение.xaml.cs
открытый частичный класс Приложение: приложение {
public App()
{
this.Startup += this.Application_Startup;
this.Exit += this.Application_Exit;
this.UnhandledException += this.Application_UnhandledException;
InitializeComponent();
}
private void Application_Startup(object sender, StartupEventArgs e)
{
//this.RootVisual = new MainPage();
(new BootStrapper()).Run();
}
private void Application_Exit(object sender, EventArgs e)
{
}
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
// If the app is running outside of the debugger then report the exception using
// the browser's exception mechanism. On IE this will display it a yellow alert
// icon in the status bar and Firefox will display a script error.
if (!System.Diagnostics.Debugger.IsAttached)
{
// NOTE: This will allow the application to continue running after an exception has been thrown
// but not handled.
// For production applications this error handling should be replaced with something that will
// report the error to the website and stop the application.
e.Handled = true;
Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
}
}
private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
{
try
{
string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
}
catch (Exception)
{
}
}
}
и выше Исключение будет, если я вызову bootsrapper.run ().
также я запускаю свой проектв режиме «Повышенное доверие при работе в браузере» и подписанный файл xap.