File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
csharp/extractor/Semmle.Extraction.CSharp.Standalone Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,18 @@ public BuildAnalysis(Options options, IProgressMonitor progress)
100100 dllDirNames . Add ( runtimeLocation ) ;
101101 }
102102
103+ if ( options . UseMscorlib )
104+ {
105+ // Add mscorlib.dll or System.Private.CoreLib.dll to the list of DLLs to reference.
106+ var loc = typeof ( object ) . Assembly . Location ;
107+ var dir = Path . GetDirectoryName ( loc ) ;
108+ if ( dir != null )
109+ {
110+ progressMonitor . Log ( Util . Logging . Severity . Debug , $ "Adding folder { dir } to DLL search path.") ;
111+ dllDirNames . Add ( dir ) ;
112+ }
113+ }
114+
103115 // These files can sometimes prevent `dotnet restore` from working correctly.
104116 using ( new FileRenamer ( sourceDir . GetFiles ( "global.json" , SearchOption . AllDirectories ) ) )
105117 using ( new FileRenamer ( sourceDir . GetFiles ( "Directory.Build.props" , SearchOption . AllDirectories ) ) )
@@ -122,11 +134,6 @@ public BuildAnalysis(Options options, IProgressMonitor progress)
122134
123135 ResolveConflicts ( ) ;
124136
125- if ( options . UseMscorlib )
126- {
127- UseReference ( typeof ( object ) . Assembly . Location ) ;
128- }
129-
130137 // Output the findings
131138 foreach ( var r in usedReferences . Keys )
132139 {
You can’t perform that action at this time.
0 commit comments