@@ -39,15 +39,21 @@ public Task RestorePackagesAsync()
39
39
{
40
40
var tcs = new TaskCompletionSource < bool > ( ) ;
41
41
42
+ string functionDirectory = null ;
43
+ string projectPath = null ;
44
+ string nugetHome = null ;
45
+ string nugetFilePath = null ;
46
+
42
47
try
43
48
{
44
- string functionDirectory = Path . GetDirectoryName ( _functionMetadata . ScriptFile ) ;
45
- string projectPath = Path . Combine ( functionDirectory , DotNetConstants . ProjectFileName ) ;
46
- string nugetHome = GetNugetPackagesPath ( ) ;
49
+ functionDirectory = Path . GetDirectoryName ( _functionMetadata . ScriptFile ) ;
50
+ projectPath = Path . Combine ( functionDirectory , DotNetConstants . ProjectFileName ) ;
51
+ nugetHome = GetNugetPackagesPath ( ) ;
52
+ nugetFilePath = ResolveNuGetPath ( ) ;
47
53
48
54
var startInfo = new ProcessStartInfo
49
55
{
50
- FileName = ResolveNuGetPath ( ) ,
56
+ FileName = nugetFilePath ,
51
57
RedirectStandardOutput = true ,
52
58
RedirectStandardError = true ,
53
59
CreateNoWindow = true ,
@@ -77,6 +83,12 @@ public Task RestorePackagesAsync()
77
83
}
78
84
catch ( Exception exc )
79
85
{
86
+ _traceWriter . Error ( $@ "NuGet restore failed with message: '{ exc . Message } '
87
+ Function directory: { functionDirectory }
88
+ Project path: { projectPath }
89
+ Packages path: { nugetHome } ,
90
+ Nuget client path: { nugetFilePath } " ) ;
91
+
80
92
tcs . SetException ( exc ) ;
81
93
}
82
94
0 commit comments