From caa4b42a89aaa04a82d605ddd917166afd0d9489 Mon Sep 17 00:00:00 2001 From: "Stefan J. Wernli" Date: Sat, 20 Mar 2021 20:05:54 -0700 Subject: [PATCH] Fix for dynamic type load when inheritance used If inheritance is used, the `this` in QCTraceSimulatorImpl wont resolve to the right assembly. This uses the QCTraceSimulatorImpl type itself so that the assembly matching the QDK can be resolved. --- .../Simulators/QCTraceSimulator/QCTraceSimulatorImpl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulatorImpl.cs b/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulatorImpl.cs index 630dced7b4e..78a52f30ada 100644 --- a/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulatorImpl.cs +++ b/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulatorImpl.cs @@ -152,7 +152,7 @@ private void RegisterPrimitiveOperationsGivenAsCircuits(Assembly? coreAssembly) var intrinsicAssembly = coreAssembly; if (intrinsicAssembly == null) { - var currentName = this.GetType().Assembly.GetName(); + var currentName = typeof(QCTraceSimulatorImpl).Assembly.GetName(); var coreName = currentName.FullName.Replace("Simulators", "QSharp.Core"); try {