Visual Studio exception

Kenn 0 Reputation points
2026-11-26T10:29:18.6633333+00:00

Hi,

I am getting the following exception when I try to run multiple projects in a solution in Visual Studio. The issue started when I upgraded to .Net 11. I have disabled "property evaluation and other implicit function calls", but it still persists.

User's image

Developer technologies | Visual Studio | Debugging

3 answers

Sort by: Most helpful
  1. Kenn 0 Reputation points
    2026-11-26T11:30:25.5833333+00:00

    Hi @Brian Pham (WICLOUD CORPORATION) ,

    I have tried all that you have mentioned except checking the event viewer, the clean and rebuild only helps temporarily and only some times it works. The exception is not consistent, but sometimes it just stops working completely.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-11-26T11:11:49.3+00:00

    Run the solution with Ctrl+F5 (Start Without Debugging); if all projects start successfully, treat this as the reported .NET 11 multi-project F5 debugger/runtime regression and update Visual Studio and its bundled .NET 11 SDK together—or temporarily return to the last working SDK—rather than changing the property-evaluation option again.^1^

    1. Isolate debugger involvement

    1. Select the same multi-project launch profile.
    2. Choose Debug > Start Without Debugging, or press Ctrl+F5.
    3. Check the result:
      • Ctrl+F5 works, F5 fails: this strongly isolates the problem to debugger/runtime interaction. A related report documents ExecutionEngineException or AccessViolationException specifically under F5.^2^
      • Ctrl+F5 also fails: investigate the Assembly.LoadFrom call and assembly resolution as described below.

    Error 0x80131506 in this matching .NET 11/F5 scenario indicates an internal CLR failure rather than an ordinary managed exception that application code can reliably catch.^1^

    2. Align Visual Studio and the .NET 11 SDK

    Open Help > About Microsoft Visual Studio and check the version, then run:

    dotnet --info
    dotnet --list-sdks
    

    The documented primary supported combination is Visual Studio 18.12 with .NET 11.0.1xx. A newer SDK can run with an older Visual Studio, but targeting its newer runtime is unsupported; for previews, only the corresponding latest Visual Studio preview is tested.^3^

    • If Visual Studio is older, update it through Visual Studio Installer > Update.
    • Prefer the .NET SDK bundled with that Visual Studio release.
    • Check for global.json in the solution or parent directories. If it pins a different SDK feature band, update it to an installed, supported SDK or temporarily remove the pin for testing.
    • If the failure began with a specific update and the latest matched Visual Studio/.NET servicing release still fails, temporarily return to the last configuration that worked and report the regression.

    3. If Ctrl+F5 also fails, inspect Assembly.LoadFrom

    Log the exact path and assembly identity before loading:

    using System.Reflection;
    
    string path = Path.GetFullPath(pluginPath);
    Console.WriteLine($"Loading: {path}");
    Console.WriteLine($"Exists: {File.Exists(path)}");
    
    AssemblyName identity = AssemblyName.GetAssemblyName(path);
    Console.WriteLine($"Identity: {identity.FullName}");
    
    Assembly assembly = Assembly.LoadFrom(path);
    

    Then check for:

    • The same assembly identity copied into multiple project output directories.
    • Different versions of the DLL loaded by separate startup projects.
    • Missing transitive dependencies beside the loaded assembly.
    • Architecture mismatch, such as a 32-bit assembly loaded into a 64-bit process.
    • A relative path resolving differently because each startup project has a different working directory.

    Assembly.LoadFrom uses the load-from context. If an assembly with the same identity is already loaded, it can return that assembly even when another path was supplied; duplicate identities in different locations can also cause InvalidCastException, MissingMethodException, or other unexpected behavior.^4^

    Where possible, use normal project/package references or a deliberate AssemblyLoadContext design instead of loading arbitrary paths.

    4. Report the regression if it remains F5-only

    In Visual Studio, select Help > Send Feedback > Report a Problem and include:

    • Visual Studio version.
    • Output of dotnet --info.
    • Whether Ctrl+F5 succeeds.
    • Whether one startup project works and multiple startup projects fail.
    • The .slnLaunch profile, with sensitive values removed.
    • The full debugger and Windows Event Viewer entries.
    • A minimal reproducer if available.

    The already-disabled implicit property evaluation setting is the documented workaround for ordinary debugger function evaluation, but its failure to help here is consistent with needing to investigate the F5/runtime path instead.^5^


    References

    1. Visual Studio multi-project F5 triggers intermittent .NET 11 CLR FuncEval crash 0x80131506 - Developer Community
    2. Visual Studio F5 triggers ExecutionEngineException or AccessViolationException - Developer Community
    3. .NET SDK, MSBuild, and Visual Studio versioning
    4. Assembly.LoadFrom Method (System.Reflection) | Microsoft Learn
    5. Error: The target process exited with code 'code' while evaluating the function 'function'
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  3. Brian Pham (WICLOUD CORPORATION) 1,595 Reputation points Microsoft External Staff Moderator
    2026-11-26T10:55:08.17+00:00

    Hi @Kenneth Udoh ,

    Thank you for sharing the details and the error screenshot.

    The error code 0x80131506 indicates a CLR execution engine failure. The message shows that the target process exited while the debugger was evaluating System.Reflection.Assembly.LoadFrom. However, this does not necessarily mean that the method itself caused the crash.

    Since the issue started after upgrading to .NET 11, I'd suggest trying the following steps to help narrow down the cause:

    • Run without debugging: Start the projects using Ctrl+F5 instead of F5 and check whether the same issue occurs.
    • Test individual projects: Run each project separately to determine whether the error only occurs when multiple projects are started together.
    • Check Windows Event Viewer: If the application still crashes, open Event Viewer > Windows Logs > Application and look for .NET Runtime or Application Error events around the time of the crash. These may provide additional details about the failure.
    • Could you also confirm your exact Visual Studio version (Help > About Microsoft Visual Studio) and whether all projects are targeting .NET 11?

    These details will help determine whether the issue is related to debugging, application startup, or the .NET runtime.

    As an additional troubleshooting step, you could try cleaning and rebuilding the solution using Build > Clean Solution, followed by Build > Rebuild Solution. This helps regenerate build outputs that may have been left over from before the .NET 11 upgrade.

    I'd also recommend checking for available updates through Visual Studio Installer, as newer releases may include relevant compatibility improvements or bug fixes. These steps may help rule out build-related or tooling issues.

    If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.

    Thank you.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.