Buildalyzer icon indicating copy to clipboard operation
Buildalyzer copied to clipboard

How to get unavailable projects, workspacefailed event?

Open doorman02 opened this issue 6 years ago • 0 comments

Thanks for this this great library, I am using the Buildalyzer to replace the MSBuildWorkspace in my .Net Core project.

In the MSBuildWorkspace there is a feature to detect when a project is unavailable. I am using this logic to detect if project files are missing on the hard drive. Hence, downloading them when they are missing. Here is the MSBuildWorkspace way of detecting when the project is unavailable the workspace will send a fail event for each project.

var missingDependencies = new List<string>();
                workspace.WorkspaceFailed += (sender, args) =>
                {
                    logger.LogError("Workspace failed with: ");
                    logger.LogError(args.Diagnostic.Message);
                    var msg = args.Diagnostic.Message;
                    if (!missingDependencies.Contains(msg))
                    {
                        missingDependencies.Add(msg);
                    }
                };

Is there a way to get a list of unavailable projects using the Buildalyzer workspace?

Thanks!

doorman02 avatar Feb 06 '20 10:02 doorman02