Skip to content

[Spec] Warnings and errors in the assets file

Justin Emgarten edited this page May 3, 2017 · 12 revisions

Restore and Build generate duplicate warnings and errors in some scenarios. To improve this restore should log messages to the assets file where they can be de-duplicated with build.

Adding messages to the assets file also improves the scenario where a user builds in a different session, possibly days after doing the restore. If the restore failed build could display the original failure messages from restore to help the user debug the problem.

Reading log messages example

var format = new LockFileFormat();

Log message interface

public interface IAssetsLogMessage
{
    LogLevel Level { get; }
    NuGetLogCode Code { get; }
    string Message { get; }
    DateTimeOffset Time { get; }
    string ProjectPath { get; }
    WarningLevel WarningLevel { get; }
    string FilePath { get; }
    int StartLineNumber { get; }
    int StartColumnNumber { get; }
    int EndLineNumber { get; }
    int EndColumnNumber { get; }
    string LibraryId { get; }
    IReadOnlyList<string> TargetGraphs { get; }
}

Assets file example

Contributing

What's Being Worked On?

Check out the proposals in the accepted & proposed folders on the repository, and active PRs for proposals being discussed today.

Common Problems

Clone this wiki locally