Refine service reference warnings and errors

- #12792
- client:
  - add error if OpenAPI file does not exist
  - separate unsupported TFM case from targets being called when disabled
- server:
  - generalize multi-targeting handling in Microsoft.Extensions.ApiDescription.Server
    - add `$(_OpenApiGenerateDocumentsTFM)`, the TFM used when invoking inner build
    - default `$(OpenApiGenerateDocuments)` to 'true' only when a supported TFM exists
  - add separate error for non-existent cache file in `OpenApiGetDocuments` target
  - add error in `GetDocumentInsider` if no documents are found
    - make `<Warning />` in the targets file an `<Error />`
    - add more text to existing `ServiceNotFound` error
- both:
  - write errors to `stderr`
  - clean up top-level output for `Exception`s
    - stop writing the `Message` twice

* Correct "Open API" mentions; should be "OpenAPI"
  - change package tags and comments

* Add service reference projects to MvcNoDeps.slnf

nits:
- add "service reference" tag in Microsoft.Extensions.ApiDescription.* packages
- add "document generation" tag in Microsoft.Extensions.ApiDescription.Server package
- `.Trim()` TFM properties because `<TargetFrameworks>;netcoreapp3.0;;</TargetFrameworks>` is allowed
- don't use bold black for verbose messages
- reorder MSBuild property settings for readability
This commit is contained in:
Doug Bunting 2019-08-14 08:36:21 -07:00
parent aafb0813e6
commit c0d5248fb4
13 changed files with 151 additions and 122 deletions

View File

@ -7,7 +7,7 @@
<IncludeBuildOutput>false</IncludeBuildOutput> <IncludeBuildOutput>false</IncludeBuildOutput>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile> <NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<PackageId>$(MSBuildProjectName)</PackageId> <PackageId>$(MSBuildProjectName)</PackageId>
<PackageTags>Build Tasks;MSBuild;Swagger;Open API;code generation; Web API client</PackageTags> <PackageTags>Build Tasks;MSBuild;Swagger;OpenAPI;code generation;Web API client;service reference</PackageTags>
<IsShippingPackage>true</IsShippingPackage> <IsShippingPackage>true</IsShippingPackage>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks> <TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<DevelopmentDependency>true</DevelopmentDependency> <DevelopmentDependency>true</DevelopmentDependency>

View File

@ -87,6 +87,8 @@
Condition="$(OpenApiGenerateCodeAtDesignTime) OR ('$(DesignTimeBuild)' != 'true' AND '$(BuildingProject)' == 'true')" Condition="$(OpenApiGenerateCodeAtDesignTime) OR ('$(DesignTimeBuild)' != 'true' AND '$(BuildingProject)' == 'true')"
Inputs="@(OpenApiReference)" Inputs="@(OpenApiReference)"
Outputs="%(OutputPath)"> Outputs="%(OutputPath)">
<Error Condition="!Exists('%(OpenApiReference.FullPath)')" Text="Input OpenAPI file %(Identity) does not exist." />
<MSBuild Projects="$(MSBuildProjectFullPath)" <MSBuild Projects="$(MSBuildProjectFullPath)"
BuildInParallel="$(BuildInParallel)" BuildInParallel="$(BuildInParallel)"
Properties="GeneratorTargetPath=%(OpenApiReference.OutputPath);GeneratorTarget=Generate%(CodeGenerator);GeneratorMetadata=%(SerializedMetadata)" Properties="GeneratorTargetPath=%(OpenApiReference.OutputPath);GeneratorTarget=Generate%(CodeGenerator);GeneratorMetadata=%(SerializedMetadata)"

View File

@ -10,7 +10,7 @@
<HasReferenceAssembly>false</HasReferenceAssembly> <HasReferenceAssembly>false</HasReferenceAssembly>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile> <NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<PackageId>$(MSBuildProjectName)</PackageId> <PackageId>$(MSBuildProjectName)</PackageId>
<PackageTags>MSBuild;Swagger;Open API;code generation;Web API</PackageTags> <PackageTags>MSBuild;Swagger;OpenAPI;code generation;Web API;service reference;document generation</PackageTags>
<IsShippingPackage>true</IsShippingPackage> <IsShippingPackage>true</IsShippingPackage>
<DevelopmentDependency>true</DevelopmentDependency> <DevelopmentDependency>true</DevelopmentDependency>

View File

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?> <?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project> <Project>
<PropertyGroup Condition=" '$(OpenApiGenerateDocuments)' == '' "> <PropertyGroup Condition=" '$(OpenApiGenerateDocuments)' == '' ">
<OpenApiGenerateDocuments>true</OpenApiGenerateDocuments>
<OpenApiGenerateDocuments <OpenApiGenerateDocuments
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(TargetFrameworkVersion.TrimStart(&quot;vV&quot;))' &lt; '2.1' ">false</OpenApiGenerateDocuments> Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(TargetFrameworkVersion.TrimStart(&quot;vV&quot;))' &lt; '2.1' " />
<OpenApiGenerateDocuments Condition=" '$(OpenApiGenerateDocuments)' == '' ">true</OpenApiGenerateDocuments> </PropertyGroup>
<PropertyGroup Condition=" '$(OpenApiGenerateDocumentsOnBuild)' == '' ">
<OpenApiGenerateDocumentsOnBuild>$(OpenApiGenerateDocuments)</OpenApiGenerateDocumentsOnBuild>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<_OpenApiDocumentsCache>$(BaseIntermediateOutputPath)$(MSBuildProjectName).OpenApiFiles.cache</_OpenApiDocumentsCache> <_OpenApiDocumentsCache>$(BaseIntermediateOutputPath)$(MSBuildProjectName).OpenApiFiles.cache</_OpenApiDocumentsCache>
<OpenApiGenerateDocumentsOnBuild
Condition=" '$(OpenApiGenerateDocumentsOnBuild)' == '' ">$(OpenApiGenerateDocuments)</OpenApiGenerateDocumentsOnBuild>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition=" '$(OpenApiGenerateDocuments)' == 'true' "> <ItemGroup Condition=" '$(OpenApiGenerateDocuments)' == 'true' ">
@ -16,23 +17,34 @@
</ItemGroup> </ItemGroup>
<Target Name="OpenApiGetDocuments" Returns="@(_OpenApiProjectDocuments)"> <Target Name="OpenApiGetDocuments" Returns="@(_OpenApiProjectDocuments)">
<Error Text="OpenAPI document generation is disabled. Add '&lt;OpenApiGenerateDocuments>true&lt;/OpenApiGenerateDocuments>' to the project." <!-- E.g. a client project has @(OpenApiProjectReference) item for project that does not support doc generation. -->
Condition=" '$(OpenApiGenerateDocuments)' != 'true' " /> <Error Condition=" '$(OpenApiGenerateDocuments)' != 'true' "
Text="OpenAPI document generation is disabled. Add '&lt;OpenApiGenerateDocuments>true&lt;/OpenApiGenerateDocuments>' to the project." />
<!-- E.g. project set $(OpenApiGenerateDocuments) to 'true' but TFM is not supported. -->
<Error
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(TargetFrameworkVersion.TrimStart(&quot;vV&quot;))' &lt; '2.1' "
Text="OpenAPI document generation is not supported when targeting netcoreapp2.0 or earlier. Disable the feature or move to a later target framework." />
<!-- E.g. project set $(OpenApiGenerateDocumentsOnBuild) to 'false' but did not invoke GenerateOpenApiDocuments. -->
<Error Condition=" !Exists('$(_OpenApiDocumentsCache)' )"
Text="$(_OpenApiDocumentsCache) file does not exist. Add '&lt;OpenApiGenerateDocumentsOnBuild>true&lt;/OpenApiGenerateDocumentsOnBuild>' to the project or call the GenerateOpenApiDocuments target." />
<ReadLinesFromFile File="$(_OpenApiDocumentsCache)"> <ReadLinesFromFile File="$(_OpenApiDocumentsCache)">
<Output TaskParameter="Lines" ItemName="_OpenApiProjectDocuments" /> <Output TaskParameter="Lines" ItemName="_OpenApiProjectDocuments" />
</ReadLinesFromFile> </ReadLinesFromFile>
<Warning Text="Application does not have any registered documents. Update its 'Startup' class to register a document." <!-- Fallback error in case something slips through the insider's error checking. -->
Condition=" '@(_OpenApiProjectDocuments)' == '' " /> <Error Condition=" '@(_OpenApiProjectDocuments)' == '' "
Text="Application does not have any registered documents. Update its 'Startup' class to register a document." />
</Target> </Target>
<Target Name="GenerateOpenApiDocuments" <Target Name="GenerateOpenApiDocuments" Inputs="$(TargetPath)" Outputs="$(_OpenApiDocumentsCache)">
Condition=" '$(OpenApiGenerateDocuments)' == 'true' " <!-- E.g. project sets $(OpenApiGenerateDocumentsOnBuild) to 'true' but $(OpenApiGenerateDocuments) is 'false'. -->
Inputs="$(TargetPath)" <Error Condition=" '$(OpenApiGenerateDocuments)' != 'true' "
Outputs="$(_OpenApiDocumentsCache)"> Text="OpenAPI document generation is disabled. Add '&lt;OpenApiGenerateDocuments>true&lt;/OpenApiGenerateDocuments>' to the project." />
<Error Text="OpenAPI document generation is not supported when targeting netcoreapp2.0 or earlier. Disable the feature or move to a later target framework." <!-- E.g. project sets $(OpenApiGenerateDocuments) to 'true' but TFM is not supported. -->
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(TargetFrameworkVersion.TrimStart(&quot;vV&quot;))' &lt; '2.1' " /> <Error
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(TargetFrameworkVersion.TrimStart(&quot;vV&quot;))' &lt; '2.1' "
Text="OpenAPI document generation is not supported when targeting netcoreapp2.0 or earlier. Disable the feature or move to a later target framework." />
<PropertyGroup> <PropertyGroup>
<_Command>dotnet "$(MSBuildThisFileDirectory)/../tools/dotnet-getdocument.dll" --assembly "$(TargetPath)"</_Command> <_Command>dotnet "$(MSBuildThisFileDirectory)/../tools/dotnet-getdocument.dll" --assembly "$(TargetPath)"</_Command>
@ -47,7 +59,7 @@
<Message Importance="high" Text="%0AGenerateOpenApiDocuments:" /> <Message Importance="high" Text="%0AGenerateOpenApiDocuments:" />
<Message Importance="high" Text=" $(_Command)" /> <Message Importance="high" Text=" $(_Command)" />
<Exec Command="$(_Command)" /> <Exec Command="$(_Command)" LogStandardErrorAsError="true" />
</Target> </Target>
<!-- Unless this is an inner build or default timing is disabled, tie document retrieval into the build. --> <!-- Unless this is an inner build or default timing is disabled, tie document retrieval into the build. -->

View File

@ -1,9 +1,25 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?> <?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project> <Project>
<ItemGroup>
<_OpenApiGenerateDocumentsTFMs Remove="@(_OpenApiGenerateDocumentsTFMs)" />
<_OpenApiGenerateDocumentsTFMs Include="$(TargetFrameworks)" Exclude="netcoreapp1.0;netcoreapp1.1;netcoreapp2.0" />
</ItemGroup>
<PropertyGroup> <PropertyGroup>
<OpenApiGenerateDocuments Condition=" '$(OpenApiGenerateDocuments)' == '' ">true</OpenApiGenerateDocuments> <!-- Default value may lead to an inner build error if $(OpenApiGenerateDocuments) is explicitly set to 'true'. -->
<_OpenApiGenerateDocumentsTFM>$(TargetFrameworks.Trim(';').Split(';')[0])</_OpenApiGenerateDocumentsTFM>
<!-- Prefer first TFM of those the tool supports. -->
<_Temporary>$(@(_OpenApiGenerateDocumentsTFMs).Trim(';'))</_Temporary>
<_OpenApiGenerateDocumentsTFM
Condition=" '$(_Temporary)' != '' ">$(_Temporary.Split(';')[0])</_OpenApiGenerateDocumentsTFM>
<OpenApiGenerateDocuments
Condition=" '$(OpenApiGenerateDocuments)' == '' AND '$(_Temporary)' != '' ">true</OpenApiGenerateDocuments>
<OpenApiGenerateDocumentsOnBuild <OpenApiGenerateDocumentsOnBuild
Condition=" '$(OpenApiGenerateDocumentsOnBuild)' == '' ">$(OpenApiGenerateDocuments)</OpenApiGenerateDocumentsOnBuild> Condition=" '$(OpenApiGenerateDocumentsOnBuild)' == '' ">$(OpenApiGenerateDocuments)</OpenApiGenerateDocumentsOnBuild>
<_Temporary />
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition=" '$(OpenApiGenerateDocuments)' == 'true' "> <ItemGroup Condition=" '$(OpenApiGenerateDocuments)' == 'true' ">
@ -13,7 +29,7 @@
<Target Name="GenerateOpenApiDocuments"> <Target Name="GenerateOpenApiDocuments">
<MSBuild Projects="$(MSBuildProjectFile)" <MSBuild Projects="$(MSBuildProjectFile)"
Targets="GenerateOpenApiDocuments" Targets="GenerateOpenApiDocuments"
Properties="TargetFramework=$(TargetFrameworks.Split(';')[0])" Properties="TargetFramework=$(_OpenApiGenerateDocumentsTFM)"
RemoveProperties="RuntimeIdentifier" /> RemoveProperties="RuntimeIdentifier" />
</Target> </Target>
@ -23,27 +39,11 @@
DependsOnTargets="GenerateOpenApiDocuments" /> DependsOnTargets="GenerateOpenApiDocuments" />
<Target Name="OpenApiGetDocuments" Returns="@(_OpenApiProjectDocuments)"> <Target Name="OpenApiGetDocuments" Returns="@(_OpenApiProjectDocuments)">
<ItemGroup>
<_Temporary Remove="@(_Temporary)" />
<_Temporary Include="$(TargetFrameworks)" Exclude="netcoreapp1.0;netcoreapp1.1;netcoreapp2.0" />
</ItemGroup>
<PropertyGroup>
<_Temporary>@(_Temporary)</_Temporary>
</PropertyGroup>
<MSBuild Projects="$(MSBuildProjectFile)" <MSBuild Projects="$(MSBuildProjectFile)"
Targets="OpenApiGetDocuments" Targets="OpenApiGetDocuments"
Condition=" '$(_Temporary)' != '' " Properties="TargetFramework=$(_OpenApiGenerateDocumentsTFM)"
Properties="TargetFramework=$(_Temporary.Split(';')[0])"
RemoveProperties="RuntimeIdentifier"> RemoveProperties="RuntimeIdentifier">
<Output TaskParameter="TargetOutputs" ItemName="_OpenApiProjectDocuments" /> <Output TaskParameter="TargetOutputs" ItemName="_OpenApiProjectDocuments" />
</MSBuild> </MSBuild>
<ItemGroup>
<_Temporary Remove="@(_Temporary)" />
</ItemGroup>
<PropertyGroup>
<_Temporary />
</PropertyGroup>
</Target> </Target>
</Project> </Project>

View File

@ -137,6 +137,7 @@ namespace Microsoft.Extensions.ApiDescription.Tool.Commands
} }
// Write out the documents. // Write out the documents.
var found = false;
Directory.CreateDirectory(context.OutputDirectory); Directory.CreateDirectory(context.OutputDirectory);
var filePathList = new List<string>(); var filePathList = new List<string>();
foreach (var documentName in documentNames) foreach (var documentName in documentNames)
@ -153,6 +154,7 @@ namespace Microsoft.Extensions.ApiDescription.Tool.Commands
} }
filePathList.Add(filePath); filePathList.Add(filePath);
found = true;
} }
// Write out the cache file. // Write out the cache file.
@ -160,7 +162,12 @@ namespace Microsoft.Extensions.ApiDescription.Tool.Commands
using var writer = new StreamWriter(stream); using var writer = new StreamWriter(stream);
writer.WriteLine(string.Join(Environment.NewLine, filePathList)); writer.WriteLine(string.Join(Environment.NewLine, filePathList));
return true; if (!found)
{
Reporter.WriteError(Resources.DocumentsNotFound);
}
return found;
} }
private static string GetDocument( private static string GetDocument(

View File

@ -33,15 +33,13 @@ namespace Microsoft.Extensions.ApiDescription.Tool
{ {
if (ex is CommandException || ex is CommandParsingException) if (ex is CommandException || ex is CommandParsingException)
{ {
Reporter.WriteVerbose(ex.ToString()); Reporter.WriteError(ex.Message);
} }
else else
{ {
Reporter.WriteInformation(ex.ToString()); Reporter.WriteError(ex.ToString());
} }
Reporter.WriteError(ex.Message);
return 1; return 1;
} }
} }

View File

@ -9,6 +9,9 @@ namespace Microsoft.Extensions.ApiDescription.Tool
{ {
internal static class Reporter internal static class Reporter
{ {
private static AnsiTextWriter Error = new AnsiTextWriter(Console.Error);
private static AnsiTextWriter Out = new AnsiTextWriter(Console.Out);
public static bool IsVerbose { get; set; } public static bool IsVerbose { get; set; }
public static bool NoColor { get; set; } public static bool NoColor { get; set; }
public static bool PrefixOutput { get; set; } public static bool PrefixOutput { get; set; }
@ -17,7 +20,7 @@ namespace Microsoft.Extensions.ApiDescription.Tool
=> NoColor ? value : colorizeFunc(value); => NoColor ? value : colorizeFunc(value);
public static void WriteError(string message) public static void WriteError(string message)
=> WriteLine(Prefix("error: ", Colorize(message, x => Bold + Red + x + Reset))); => WriteLine(Prefix("error: ", Colorize(message, x => Bold + Red + x + Reset)), isError: true);
public static void WriteWarning(string message) public static void WriteWarning(string message)
=> WriteLine(Prefix("warn: ", Colorize(message, x => Bold + Yellow + x + Reset))); => WriteLine(Prefix("warn: ", Colorize(message, x => Bold + Yellow + x + Reset)));
@ -32,7 +35,7 @@ namespace Microsoft.Extensions.ApiDescription.Tool
{ {
if (IsVerbose) if (IsVerbose)
{ {
WriteLine(Prefix("verbose: ", Colorize(message, x => Bold + Black + x + Reset))); WriteLine(Prefix("verbose: ", Colorize(message, x => Gray + x + Reset)));
} }
} }
@ -43,15 +46,15 @@ namespace Microsoft.Extensions.ApiDescription.Tool
value.Split(new[] { Environment.NewLine }, StringSplitOptions.None).Select(l => prefix + l)) value.Split(new[] { Environment.NewLine }, StringSplitOptions.None).Select(l => prefix + l))
: value; : value;
private static void WriteLine(string value) private static void WriteLine(string value, bool isError = false)
{ {
if (NoColor) if (NoColor)
{ {
Console.WriteLine(value); (isError ? Console.Error : Console.Out).WriteLine(value);
} }
else else
{ {
AnsiConsole.WriteLine(value); (isError ? Error : Out).WriteLine(value);
} }
} }
} }

View File

@ -151,7 +151,8 @@
<value>Method '{0}' not found in type '{1}' with expected signature.</value> <value>Method '{0}' not found in type '{1}' with expected signature.</value>
</data> </data>
<data name="ServiceNotFound" xml:space="preserve"> <data name="ServiceNotFound" xml:space="preserve">
<value>Unable to find service type '{0}' in dependency injection container.</value> <value>Unable to find service type '{0}' in dependency injection container. Update the 'Startup' class to register a document.</value>
<comment>Do not translate 'Startup'</comment>
</data> </data>
<data name="MethodReturnedNull" xml:space="preserve"> <data name="MethodReturnedNull" xml:space="preserve">
<value>Method '{0}' of type '{1}' returned null. Must return a non-null '{2}'.</value> <value>Method '{0}' of type '{1}' returned null. Must return a non-null '{2}'.</value>
@ -186,4 +187,8 @@
<data name="ServiceProviderNotFound" xml:space="preserve"> <data name="ServiceProviderNotFound" xml:space="preserve">
<value>Unable to resolve a non-null '{0}' implementation using method '{1}', '{2}' or '{3}' of type '{4}'.</value> <value>Unable to resolve a non-null '{0}' implementation using method '{1}', '{2}' or '{3}' of type '{4}'.</value>
</data> </data>
<data name="DocumentsNotFound" xml:space="preserve">
<value>Unable to find any registered documents. Update the 'Startup' class to register a document.</value>
<comment>Do not translate 'Startup'</comment>
</data>
</root> </root>

View File

@ -2,39 +2,15 @@
"solution": { "solution": {
"path": "Mvc.sln", "path": "Mvc.sln",
"projects": [ "projects": [
"test\\WebSites\\BasicWebSite\\BasicWebSite.csproj", "Extensions.ApiDescription.Client\\src\\Microsoft.Extensions.ApiDescription.Client.csproj",
"test\\WebSites\\RoutingWebSite\\Mvc.RoutingWebSite.csproj", "Extensions.ApiDescription.Server\\src\\Microsoft.Extensions.ApiDescription.Server.csproj",
"test\\WebSites\\RazorWebSite\\RazorWebSite.csproj", "GetDocumentInsider\\src\\GetDocumentInsider.csproj",
"test\\WebSites\\FormatterWebSite\\FormatterWebSite.csproj",
"test\\WebSites\\ApiExplorerWebSite\\ApiExplorerWebSite.csproj",
"test\\WebSites\\VersioningWebSite\\VersioningWebSite.csproj",
"test\\WebSites\\TagHelpersWebSite\\TagHelpersWebSite.csproj",
"test\\WebSites\\FilesWebSite\\FilesWebSite.csproj",
"test\\WebSites\\ApplicationModelWebSite\\ApplicationModelWebSite.csproj",
"test\\WebSites\\HtmlGenerationWebSite\\HtmlGenerationWebSite.csproj",
"test\\WebSites\\ErrorPageMiddlewareWebSite\\ErrorPageMiddlewareWebSite.csproj",
"test\\WebSites\\XmlFormattersWebSite\\XmlFormattersWebSite.csproj",
"test\\WebSites\\ControllersFromServicesWebSite\\ControllersFromServicesWebSite.csproj",
"test\\WebSites\\ControllersFromServicesClassLibrary\\ControllersFromServicesClassLibrary.csproj",
"test\\WebSites\\CorsWebSite\\CorsWebSite.csproj",
"samples\\MvcSandbox\\MvcSandbox.csproj",
"test\\WebSites\\SimpleWebSite\\SimpleWebSite.csproj",
"test\\WebSites\\SecurityWebSite\\SecurityWebSite.csproj",
"test\\WebSites\\RazorPagesWebSite\\RazorPagesWebSite.csproj",
"benchmarks\\Microsoft.AspNetCore.Mvc.Performance\\Microsoft.AspNetCore.Mvc.Performance.csproj",
"test\\WebSites\\RazorBuildWebSite\\RazorBuildWebSite.csproj",
"test\\WebSites\\RazorBuildWebSite.Views\\RazorBuildWebSite.Views.csproj",
"Mvc.Analyzers\\src\\Microsoft.AspNetCore.Mvc.Analyzers.csproj",
"Mvc.Analyzers\\test\\Mvc.Analyzers.Test.csproj",
"test\\WebSites\\RazorPagesClassLibrary\\RazorPagesClassLibrary.csproj",
"shared\\Mvc.Views.TestCommon\\Microsoft.AspNetCore.Mvc.Views.TestCommon.csproj",
"Mvc.Api.Analyzers\\test\\Mvc.Api.Analyzers.Test.csproj",
"Mvc.Api.Analyzers\\src\\Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj",
"test\\WebSites\\GenericHostWebSite\\GenericHostWebSite.csproj",
"Mvc\\src\\Microsoft.AspNetCore.Mvc.csproj",
"Mvc\\test\\Microsoft.AspNetCore.Mvc.Test.csproj",
"Mvc.Abstractions\\src\\Microsoft.AspNetCore.Mvc.Abstractions.csproj", "Mvc.Abstractions\\src\\Microsoft.AspNetCore.Mvc.Abstractions.csproj",
"Mvc.Abstractions\\test\\Microsoft.AspNetCore.Mvc.Abstractions.Test.csproj", "Mvc.Abstractions\\test\\Microsoft.AspNetCore.Mvc.Abstractions.Test.csproj",
"Mvc.Analyzers\\src\\Microsoft.AspNetCore.Mvc.Analyzers.csproj",
"Mvc.Analyzers\\test\\Mvc.Analyzers.Test.csproj",
"Mvc.Api.Analyzers\\src\\Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj",
"Mvc.Api.Analyzers\\test\\Mvc.Api.Analyzers.Test.csproj",
"Mvc.ApiExplorer\\src\\Microsoft.AspNetCore.Mvc.ApiExplorer.csproj", "Mvc.ApiExplorer\\src\\Microsoft.AspNetCore.Mvc.ApiExplorer.csproj",
"Mvc.ApiExplorer\\test\\Microsoft.AspNetCore.Mvc.ApiExplorer.Test.csproj", "Mvc.ApiExplorer\\test\\Microsoft.AspNetCore.Mvc.ApiExplorer.Test.csproj",
"Mvc.Core\\src\\Microsoft.AspNetCore.Mvc.Core.csproj", "Mvc.Core\\src\\Microsoft.AspNetCore.Mvc.Core.csproj",
@ -48,24 +24,52 @@
"Mvc.Formatters.Xml\\test\\Microsoft.AspNetCore.Mvc.Formatters.Xml.Test.csproj", "Mvc.Formatters.Xml\\test\\Microsoft.AspNetCore.Mvc.Formatters.Xml.Test.csproj",
"Mvc.Localization\\src\\Microsoft.AspNetCore.Mvc.Localization.csproj", "Mvc.Localization\\src\\Microsoft.AspNetCore.Mvc.Localization.csproj",
"Mvc.Localization\\test\\Microsoft.AspNetCore.Mvc.Localization.Test.csproj", "Mvc.Localization\\test\\Microsoft.AspNetCore.Mvc.Localization.Test.csproj",
"Mvc.Razor\\src\\Microsoft.AspNetCore.Mvc.Razor.csproj",
"Mvc.Razor\\test\\Microsoft.AspNetCore.Mvc.Razor.Test.csproj",
"Mvc.RazorPages\\src\\Microsoft.AspNetCore.Mvc.RazorPages.csproj",
"Mvc.RazorPages\\test\\Microsoft.AspNetCore.Mvc.RazorPages.Test.csproj",
"Mvc.TagHelpers\\src\\Microsoft.AspNetCore.Mvc.TagHelpers.csproj",
"Mvc.TagHelpers\\test\\Microsoft.AspNetCore.Mvc.TagHelpers.Test.csproj",
"Mvc.ViewFeatures\\src\\Microsoft.AspNetCore.Mvc.ViewFeatures.csproj",
"Mvc.ViewFeatures\\test\\Microsoft.AspNetCore.Mvc.ViewFeatures.Test.csproj",
"test\\Mvc.FunctionalTests\\Microsoft.AspNetCore.Mvc.FunctionalTests.csproj",
"test\\Mvc.IntegrationTests\\Microsoft.AspNetCore.Mvc.IntegrationTests.csproj",
"shared\\Mvc.TestDiagnosticListener\\Microsoft.AspNetCore.Mvc.TestDiagnosticListener.csproj",
"Mvc.Testing\\src\\Microsoft.AspNetCore.Mvc.Testing.csproj",
"shared\\Mvc.Core.TestCommon\\Microsoft.AspNetCore.Mvc.Core.TestCommon.csproj",
"Mvc.NewtonsoftJson\\src\\Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj", "Mvc.NewtonsoftJson\\src\\Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj",
"Mvc.NewtonsoftJson\\test\\Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test.csproj", "Mvc.NewtonsoftJson\\test\\Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test.csproj",
"Mvc.Razor.RuntimeCompilation\\src\\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj", "Mvc.Razor.RuntimeCompilation\\src\\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj",
"Mvc.Razor.RuntimeCompilation\\test\\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test.csproj", "Mvc.Razor.RuntimeCompilation\\test\\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test.csproj",
"test\\WebSites\\RazorBuildWebSite.PrecompiledViews\\RazorBuildWebSite.PrecompiledViews.csproj" "Mvc.RazorPages\\src\\Microsoft.AspNetCore.Mvc.RazorPages.csproj",
"Mvc.RazorPages\\test\\Microsoft.AspNetCore.Mvc.RazorPages.Test.csproj",
"Mvc.Razor\\src\\Microsoft.AspNetCore.Mvc.Razor.csproj",
"Mvc.Razor\\test\\Microsoft.AspNetCore.Mvc.Razor.Test.csproj",
"Mvc.TagHelpers\\src\\Microsoft.AspNetCore.Mvc.TagHelpers.csproj",
"Mvc.TagHelpers\\test\\Microsoft.AspNetCore.Mvc.TagHelpers.Test.csproj",
"Mvc.Testing\\src\\Microsoft.AspNetCore.Mvc.Testing.csproj",
"Mvc.ViewFeatures\\src\\Microsoft.AspNetCore.Mvc.ViewFeatures.csproj",
"Mvc.ViewFeatures\\test\\Microsoft.AspNetCore.Mvc.ViewFeatures.Test.csproj",
"Mvc\\src\\Microsoft.AspNetCore.Mvc.csproj",
"Mvc\\test\\Microsoft.AspNetCore.Mvc.Test.csproj",
"benchmarks\\Microsoft.AspNetCore.Mvc.Performance\\Microsoft.AspNetCore.Mvc.Performance.csproj",
"dotnet-getdocument\\src\\dotnet-getdocument.csproj",
"samples\\MvcSandbox\\MvcSandbox.csproj",
"shared\\Mvc.Core.TestCommon\\Microsoft.AspNetCore.Mvc.Core.TestCommon.csproj",
"shared\\Mvc.TestDiagnosticListener\\Microsoft.AspNetCore.Mvc.TestDiagnosticListener.csproj",
"shared\\Mvc.Views.TestCommon\\Microsoft.AspNetCore.Mvc.Views.TestCommon.csproj",
"test\\Mvc.FunctionalTests\\Microsoft.AspNetCore.Mvc.FunctionalTests.csproj",
"test\\Mvc.IntegrationTests\\Microsoft.AspNetCore.Mvc.IntegrationTests.csproj",
"test\\WebSites\\ApiExplorerWebSite\\ApiExplorerWebSite.csproj",
"test\\WebSites\\ApplicationModelWebSite\\ApplicationModelWebSite.csproj",
"test\\WebSites\\BasicWebSite\\BasicWebSite.csproj",
"test\\WebSites\\ControllersFromServicesClassLibrary\\ControllersFromServicesClassLibrary.csproj",
"test\\WebSites\\ControllersFromServicesWebSite\\ControllersFromServicesWebSite.csproj",
"test\\WebSites\\CorsWebSite\\CorsWebSite.csproj",
"test\\WebSites\\ErrorPageMiddlewareWebSite\\ErrorPageMiddlewareWebSite.csproj",
"test\\WebSites\\FilesWebSite\\FilesWebSite.csproj",
"test\\WebSites\\FormatterWebSite\\FormatterWebSite.csproj",
"test\\WebSites\\GenericHostWebSite\\GenericHostWebSite.csproj",
"test\\WebSites\\HtmlGenerationWebSite\\HtmlGenerationWebSite.csproj",
"test\\WebSites\\RazorBuildWebSite.PrecompiledViews\\RazorBuildWebSite.PrecompiledViews.csproj",
"test\\WebSites\\RazorBuildWebSite.Views\\RazorBuildWebSite.Views.csproj",
"test\\WebSites\\RazorBuildWebSite\\RazorBuildWebSite.csproj",
"test\\WebSites\\RazorPagesClassLibrary\\RazorPagesClassLibrary.csproj",
"test\\WebSites\\RazorPagesWebSite\\RazorPagesWebSite.csproj",
"test\\WebSites\\RazorWebSite\\RazorWebSite.csproj",
"test\\WebSites\\RoutingWebSite\\Mvc.RoutingWebSite.csproj",
"test\\WebSites\\SecurityWebSite\\SecurityWebSite.csproj",
"test\\WebSites\\SimpleWebSite\\SimpleWebSite.csproj",
"test\\WebSites\\TagHelpersWebSite\\TagHelpersWebSite.csproj",
"test\\WebSites\\VersioningWebSite\\VersioningWebSite.csproj",
"test\\WebSites\\XmlFormattersWebSite\\XmlFormattersWebSite.csproj"
] ]
} }
} }

View File

@ -27,15 +27,13 @@ namespace Microsoft.Extensions.ApiDescription.Tool
{ {
if (ex is CommandException || ex is CommandParsingException) if (ex is CommandException || ex is CommandParsingException)
{ {
Reporter.WriteVerbose(ex.ToString()); Reporter.WriteError(ex.Message);
} }
else else
{ {
Reporter.WriteInformation(ex.ToString()); Reporter.WriteError(ex.ToString());
} }
Reporter.WriteError(ex.Message);
return 1; return 1;
} }
} }