An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Thanks for reaching out.
You’re hitting classic assembly binding/version skew on .NET Framework: the app compiles against one set of packages but loads different versions at runtime, which triggers errors such as:
System.IO.FileLoadException (0x80131040) Could not load file or assembly 'Microsoft.Graph.Core, Version=2.0.13.0... The located assembly's manifest definition does not match the assembly reference.
This typically cascades to System.Text.Json, System.Memory, System.Buffers, etc.
Below is a proven setup to eliminate these errors for the LocalMediaSamples (application‑hosted media) on Windows Server + .NET Framework.
- Pin a compatible NuGet package set (no mixing)
Ensure all Graph Communications SDK packages and the Skype media library are version‑aligned. Install/update explicitly from Package Manager Console:
bot2.txt
- Retarget to .NET Framework 4.8 (recommended)
You can stay on 4.7.2, but 4.8 reduces binding friction and enables modern TLS defaults.
- Project → Properties → Target framework: .NET Framework 4.8
- Install the .NET Framework 4.8 Developer Pack if missing.
bot1.txt
- Enable auto binding redirects and add an explicit
App.config
- Project → Properties → Application → check Auto‑generate binding redirects.
- Add an
App.configwith explicit redirects for the assemblies that drift most often.
**Starter App.config (adjust newVersion to your installed versions):
**
4) Clean out stale binaries and caches
dotnet nuget locals all --clear
Reopen the solution → Restore → **Rebuild
**.5) Verify with Fusion Log Viewer (Fuslogvw.exe)
Use Fusion logs to see exactly which version the CLR is trying to load and where it probes:
- Run
Fuslogvw.exe. - Enable Log Failures and Bindings; set a custom log path.
- Reproduce once; open the latest log entry.
- Confirm your
App.configredirects match the requested versions shown in the log.
6) Remove conflicting references
- Standardize on packages.config (or PackageReference)—avoid mixing across projects.
- Ensure all projects reference the same versions of
Microsoft.Graph*andSystem.*packages. - Make the bot executable the startup project (binding redirects apply to the entry appdomain).
7) Optional: fresh re‑setup (fastest if you’ve iterated a lot)
- Clone the sample fresh.
- Retarget to .NET Framework 4.8.
- Install the package set from step 1.
- Add the
App.configabove. - Restore → Rebuild → Run; use Fusion logs only if an error remains.
Why this works
1. The Calling/Media SDKs were compiled against **specific** Graph client versions; mixing newer/older packages breaks assembly identity.
1. `System.Text.Json` on .NET Framework pulls `System.Memory`, `Buffers`, `Unsafe` via netstandard—these must be **version‑compatible** and redirected to **one** resolved version at runtime.
Please let us know if you require any further assistance, we’re happy to help.
If you found this information useful, kindly mark this as "Accept Answer".