Skip to content

Commit

Permalink
Merge pull request #2149 from jasonmalinowski/fix-appdomain-hook
Browse files Browse the repository at this point in the history
Only subscribe to AppDomain.AssemblyResolve once
  • Loading branch information
JoeRobich committed May 6, 2021
2 parents 2f1efb0 + e370afa commit f343373
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OmniSharp.Host/Services/AnalyzerAssemblyLoader.cs
Expand Up @@ -231,7 +231,7 @@ private Assembly LoadFromPathImpl(string originalPath)
string assemblyDirectory = CreateUniqueDirectoryForAssembly();
string shadowCopyPath = CopyFileAndResources(originalPath, assemblyDirectory);

if (Interlocked.CompareExchange(ref _hookedAssemblyResolve, 0, 1) == 0)
if (Interlocked.CompareExchange(ref _hookedAssemblyResolve, value: 1, comparand: 0) == 0)
{
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
}
Expand Down

0 comments on commit f343373

Please sign in to comment.