diff --git a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/Utilities/DotNetHelpers.cs b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/Utilities/DotNetHelpers.cs index 1c9ef41220..399197b5ab 100644 --- a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/Utilities/DotNetHelpers.cs +++ b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/Utilities/DotNetHelpers.cs @@ -143,6 +143,11 @@ public static string GetDebugShimFilename(int bitness) { default: throw new ArgumentOutOfRangeException(nameof(bitness)); } #elif NET + string path = Path.Combine(basePath, filename); + // If dnSpy is published, the file will be located in the app directory + if (File.Exists(path)) + return path; + // If dnSpy is ran from source, the file will be located in a different directory return Path.Combine(basePath, "runtimes", RuntimeInformation.RuntimeIdentifier, "native", filename); #else #error Unknown target framework