NuGet logs for debugging

Topics: General
Jun 12, 2012 at 6:42 PM


I have noticed that sometimes if some references are manually deleted (instead of unsinstalling via the package manager) you see a "Some NuGet packages are missing from this solution. Click to restore" message. And then sometimes when you click on Restore it fails to restore these missing packages. Sadly, all it tells the user is "An error occurred while trying to restore packages. Please try again." And no matter how many times you retry the packages aren't restore.

It would be really helpful to understand what's happening under the hood. So I wonder, where does NuGet log error messages? Or if there is a way to switch to debug logging?



Jun 12, 2012 at 10:05 PM

if you run Visual Studio from the command line, for example:

devenv.exe /log "c:\log.xml"

then NuGet will log the error into the specified file.

Nov 21, 2012 at 1:38 AM

I downloaded the following copy of NuGet Gallery: fa9319f48d

When I run the restore functionality the following error are logged in the visual studio log file.

Error #1:

Exception setting "WindowTitle": "The method or operation is not implemented." at System.Management.Automation.PropertyReferenceNode.SetValue(PSObject obj, Object property, Object value, ExecutionContext context) at System.Management.Automation.AssignablePropertyReference.SetValue(Object value, ExecutionContext context) at System.Management.Automation.AssignmentStatementNode.Execute(Array input, Pipe outputPipe, ExecutionContext context) at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)     NuGet Package Manager


Error #2

The remote server returned an error: (403) Forbidden. at System.Net.HttpWebRequest.GetResponse() at NuGet.RequestHelper.GetResponse(Func`1 createRequest, Action`1 prepareRequest, IProxyCache proxyCache, ICredentialCache credentialCache, ICredentialProvider credentialProvider) at NuGet.HttpClient.GetResponse() at NuGet.HttpClient.DownloadData() at NuGet.PackageDownloader.DownloadPackage(IHttpClient downloadClient, IPackageMetadata package) at NuGet.PackageDownloader.DownloadPackage(Uri uri, IPackageMetadata package) at NuGet.DataServicePackage.EnsurePackage(IPackageRepository cacheRepository) at NuGet.DataServicePackage.get_FrameworkAssemblies() at NuGet.PackageExtensions.HasProjectContent(IPackage package) at NuGet.PackageWalker.GetPackageTarget(IPackage package) at NuGet.PackageWalker.GetPackageInfo(IPackage package) at NuGet.PackageWalker.ProcessPackageTarget(IPackage package) at NuGet.PackageWalker.Walk(IPackage package) at NuGet.InstallWalker.ResolveOperations(IPackage package) at NuGet.PackageManager.Execute(IPackage package, IPackageOperationResolver resolver) at NuGet.PackageManager.InstallPackage(IPackage package, FrameworkName targetFramework, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) at NuGet.PackageManager.InstallPackage(IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) at NuGet.PackageManager.InstallPackage(String packageId, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) at NuGet.VisualStudio.PackageRestoreManager.<RestoreMissingPackages>b__2() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute()     NuGet Package Manager