FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Show details of errors occurred when the generator opens a project by mayuki · Pull Request #1558 · MessagePack-CSharp/MessagePack-CSharp · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cs  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 7 additions & 0 deletions src/MessagePack.Generator/MessagepackCompiler.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Loader;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -90,6 +91,12 @@ public async Task RunAsync(
{
var logger = new ConsoleLogger(Microsoft.Build.Framework.LoggerVerbosity.Quiet);
var project = await workspace.OpenProjectAsync(projectPath, logger, null, cancellationToken);
if (workspace.Diagnostics.Any(x => x.Kind is WorkspaceDiagnosticKind.Failure))
{
throw new InvalidOperationException("One or more errors occured while opening the project:" + Environment.NewLine +
string.Join(Environment.NewLine, workspace.Diagnostics.Select(x => $"========================================{Environment.NewLine}{x.Message}{Environment.NewLine}========================================")));
}

var compilation = await project.GetCompilationAsync(cancellationToken);
if (compilation is null)
{
Expand Down

Back | FazBrowse Home | New Git URL