@@ -180,35 +180,45 @@ private static bool TryParseSpanContext(Activity currentActivity, out ulong trac
180180 // and optional on .NET Core
181181 private static class Windows
182182 {
183+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
183184 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native.dll" ) ]
184185 public static extern void AddInstrumentations ( [ MarshalAs ( UnmanagedType . LPWStr ) ] string id , [ In ] NativeCallTargetDefinition [ ] methodArrays , int size ) ;
185186
187+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
186188 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native.dll" ) ]
187189 public static extern void AddDerivedInstrumentations ( [ MarshalAs ( UnmanagedType . LPWStr ) ] string id , [ In ] NativeCallTargetDefinition [ ] methodArrays , int size ) ;
188190
191+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
189192 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native.dll" ) ]
190193 public static extern void ConfigureContinuousProfiler ( bool threadSamplingEnabled , uint threadSamplingInterval , bool allocationSamplingEnabled , uint maxMemorySamplesPerMinute , uint selectedThreadSamplingInterval ) ;
191194
192195#if NET
193196
197+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
194198 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native.dll" ) ]
195199 public static extern int ContinuousProfilerReadThreadSamples ( int len , byte [ ] buf ) ;
196200
201+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
197202 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native.dll" ) ]
198203 public static extern int ContinuousProfilerReadAllocationSamples ( int len , byte [ ] buf ) ;
199204
205+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
200206 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native.dll" ) ]
201207 public static extern int SelectiveSamplerReadThreadSamples ( int len , byte [ ] buf ) ;
202208
209+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
203210 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native.dll" ) ]
204211 public static extern void ContinuousProfilerSetNativeContext ( ulong traceIdHigh , ulong traceIdLow , ulong spanId ) ;
205212
213+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
206214 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native.dll" ) ]
207215 public static extern void ContinuousProfilerNotifySpanStopped ( ulong traceIdHigh , ulong traceIdLow , ulong spanId ) ;
208216
217+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
209218 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native.dll" ) ]
210219 public static extern void SelectiveSamplingStart ( ulong traceIdHigh , ulong traceIdLow ) ;
211220
221+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
212222 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native.dll" ) ]
213223 public static extern void SelectiveSamplingStop ( ulong traceIdHigh , ulong traceIdLow ) ;
214224#endif
@@ -218,34 +228,44 @@ private static class Windows
218228 // assume .NET Core if not running on Windows
219229 private static class NonWindows
220230 {
231+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
221232 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native" ) ]
222233 public static extern void AddInstrumentations ( [ MarshalAs ( UnmanagedType . LPWStr ) ] string id , [ In ] NativeCallTargetDefinition [ ] methodArrays , int size ) ;
223234
235+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
224236 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native" ) ]
225237 public static extern void AddDerivedInstrumentations ( [ MarshalAs ( UnmanagedType . LPWStr ) ] string id , [ In ] NativeCallTargetDefinition [ ] methodArrays , int size ) ;
226238
239+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
227240 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native" ) ]
228241 public static extern void ConfigureContinuousProfiler ( bool threadSamplingEnabled , uint threadSamplingInterval , bool allocationSamplingEnabled , uint maxMemorySamplesPerMinute , uint selectedThreadSamplingInterval ) ;
229242
230243#if NET
244+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
231245 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native" ) ]
232246 public static extern int ContinuousProfilerReadThreadSamples ( int len , byte [ ] buf ) ;
233247
248+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
234249 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native" ) ]
235250 public static extern int ContinuousProfilerReadAllocationSamples ( int len , byte [ ] buf ) ;
236251
252+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
237253 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native" ) ]
238254 public static extern int SelectiveSamplerReadThreadSamples ( int len , byte [ ] buf ) ;
239255
256+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
240257 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native" ) ]
241258 public static extern void ContinuousProfilerSetNativeContext ( ulong traceIdHigh , ulong traceIdLow , ulong spanId ) ;
242259
260+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
243261 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native" ) ]
244262 public static extern void ContinuousProfilerNotifySpanStopped ( ulong traceIdHigh , ulong traceIdLow , ulong spanId ) ;
245263
264+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
246265 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native" ) ]
247266 public static extern void SelectiveSamplingStart ( ulong traceIdHigh , ulong traceIdLow ) ;
248267
268+ [ DefaultDllImportSearchPaths ( DllImportSearchPath . SafeDirectories ) ]
249269 [ DllImport ( "OpenTelemetry.AutoInstrumentation.Native" ) ]
250270 public static extern void SelectiveSamplingStop ( ulong traceIdHigh , ulong traceIdLow ) ;
251271#endif
0 commit comments