Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

226
Vistas
LoadFromContext Occurred

I have a very simple C# problem that loads a Windows WPF window from a library. Here's the code:

public partial class App : Application
{
    public App()
    {
        MainWindow mainWindow = new MainWindow();
        mainWindow.Show();
    }
}

But when I run it breaks on the mainWindow.Show(); line with the following error:

Managed Debugging Assistant 'LoadFromContext' has detected a problem in 'C:\Users.....\bin\Debug\Test.vshost.exe'.

Additional information: The assembly named 'WpfXamlDiagnosticsTap' was loaded from 'file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/CLIENTDIAGNOSTICS/XAMLDIAGNOSTICS/x64/WpfXamlDiagnosticsTap.dll' using the LoadFrom context.

The use of this context can result in unexpected behavior for serialization, casting and dependency resolution. In almost all cases, it is recommended that the LoadFrom context be avoided. This can be done by installing assemblies in the Global Assembly Cache or in the ApplicationBase directory and using Assembly.Load when explicitly loading assemblies.

The MainWindow class just extends from System.Windows.Window; I'm not exactly sure what this means and how to solve. Just upgraded to Visual Studio 2015.

enter image description here

enter image description here

If I ignore the exception and continue I get this when I close the last window:

enter image description here

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

I'm running into the same issue after switching from Visual Studio 2013 to 2015. Some old projects (WPF, .NET 4.5, MVVM Light) produce this error - other not. In visual Studio i can skip the exception but newly created releases stop while loading and try to open the JIT Debugger.

Until now the only solution seems to be a rollback to Visual Studio 2013.

** UPDATE **

Finally I solved it in VS 2015 by unchecking the following option:

Tools –> Options –> Debugging –> General –> Enable UI Debugging Tools for XAML

over 4 years ago · Santiago Trujillo Denunciar

0

I all of a sudden started seeing this error in VS2015 and fixed it by opening the "Exception Settings" Window (CTRL + ALT + E) and press the "Restore Settings" Button :

enter image description here

over 4 years ago · Santiago Trujillo Denunciar

0

In VS2015 I am getting two exceptions from WpfXamlDiagnosticsTap.dll

  1. The first one is "LoadFromContext" and it occurs when activating the first window.
  2. The second one is "NotMarshalable" and it occurs when closing that window.

Simply ignoring those two Exception types allows me to run the application, and use the UI Debugging tools. I haven't observed any adverse effects.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda