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)
100
100
dllDirNames . Add ( runtimeLocation ) ;
101
101
}
102
102
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
+
103
115
// These files can sometimes prevent `dotnet restore` from working correctly.
104
116
using ( new FileRenamer ( sourceDir . GetFiles ( "global.json" , SearchOption . AllDirectories ) ) )
105
117
using ( new FileRenamer ( sourceDir . GetFiles ( "Directory.Build.props" , SearchOption . AllDirectories ) ) )
@@ -122,11 +134,6 @@ public BuildAnalysis(Options options, IProgressMonitor progress)
122
134
123
135
ResolveConflicts ( ) ;
124
136
125
- if ( options . UseMscorlib )
126
- {
127
- UseReference ( typeof ( object ) . Assembly . Location ) ;
128
- }
129
-
130
137
// Output the findings
131
138
foreach ( var r in usedReferences . Keys )
132
139
{
You can’t perform that action at this time.
0 commit comments