@@ -203,26 +203,28 @@ public string[] GetIntegrationsFilePaths()
203
203
204
204
if ( ! File . Exists ( _integrationsFileLocation ) )
205
205
{
206
- _output . WriteLine ( $ "Unable to find integrations at { _profilerFileLocation } .") ;
206
+ _output . WriteLine ( $ "Attempt 1: Unable to find integrations at { _integrationsFileLocation } .") ;
207
207
// Let's try the executing directory, as dotnet publish ignores the Copy attributes we currently use
208
- _profilerFileLocation = Path . Combine (
208
+ _integrationsFileLocation = Path . Combine (
209
209
GetExecutingProjectBin ( ) ,
210
210
relativePath ) ;
211
211
}
212
212
213
213
if ( ! File . Exists ( _integrationsFileLocation ) )
214
214
{
215
- _output . WriteLine ( $ "Fallback 1 : Unable to find integrations at { _profilerFileLocation } .") ;
216
- // One last attempt at the actual native project directory
217
- _profilerFileLocation = Path . Combine (
218
- GetProfilerProjectBin ( ) ,
215
+ _output . WriteLine ( $ "Attempt 2 : Unable to find integrations at { _integrationsFileLocation } .") ;
216
+ // One last attempt at the solution root
217
+ _integrationsFileLocation = Path . Combine (
218
+ GetSolutionDirectory ( ) ,
219
219
fileName ) ;
220
220
}
221
221
222
222
if ( ! File . Exists ( _integrationsFileLocation ) )
223
223
{
224
- throw new Exception ( $ "Fallback 2 : Unable to find integrations at { _integrationsFileLocation } ") ;
224
+ throw new Exception ( $ "Attempt 3 : Unable to find integrations at { _integrationsFileLocation } ") ;
225
225
}
226
+
227
+ _output . WriteLine ( $ "Found integrations at { _integrationsFileLocation } .") ;
226
228
}
227
229
228
230
return new [ ]
@@ -243,38 +245,40 @@ public string GetProfilerPath()
243
245
244
246
var directory = GetSampleApplicationOutputDirectory ( ) ;
245
247
246
- var profilerRelativePath = Path . Combine (
248
+ var relativePath = Path . Combine (
247
249
"profiler-lib" ,
248
250
fileName ) ;
249
251
250
252
_profilerFileLocation = Path . Combine (
251
253
directory ,
252
- profilerRelativePath ) ;
254
+ relativePath ) ;
253
255
254
256
// TODO: get rid of the fallback options when we have a consistent convention
255
257
256
258
if ( ! File . Exists ( _profilerFileLocation ) )
257
259
{
258
- _output . WriteLine ( $ "Unable to find profiler at { _profilerFileLocation } .") ;
260
+ _output . WriteLine ( $ "Attempt 1: Unable to find profiler at { _profilerFileLocation } .") ;
259
261
// Let's try the executing directory, as dotnet publish ignores the Copy attributes we currently use
260
- _profilerFileLocation = Path . Combine (
262
+ _integrationsFileLocation = Path . Combine (
261
263
GetExecutingProjectBin ( ) ,
262
- profilerRelativePath ) ;
264
+ relativePath ) ;
263
265
}
264
266
265
267
if ( ! File . Exists ( _profilerFileLocation ) )
266
268
{
267
- _output . WriteLine ( $ "Fallback 1 : Unable to find profiler at { _profilerFileLocation } .") ;
269
+ _output . WriteLine ( $ "Attempt 2 : Unable to find profiler at { _profilerFileLocation } .") ;
268
270
// One last attempt at the actual native project directory
269
- _profilerFileLocation = Path . Combine (
271
+ _integrationsFileLocation = Path . Combine (
270
272
GetProfilerProjectBin ( ) ,
271
273
fileName ) ;
272
274
}
273
275
274
276
if ( ! File . Exists ( _profilerFileLocation ) )
275
277
{
276
- throw new Exception ( $ "Fallback 2 : Unable to find profiler at { _profilerFileLocation } ") ;
278
+ throw new Exception ( $ "Attempt 3 : Unable to find profiler at { _profilerFileLocation } ") ;
277
279
}
280
+
281
+ _output . WriteLine ( $ "Found profiler at { _profilerFileLocation } .") ;
278
282
}
279
283
280
284
return _profilerFileLocation ;
0 commit comments