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:
parent
aafb0813e6
commit
c0d5248fb4
|
|
@ -7,7 +7,7 @@
|
|||
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||||
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
|
||||
<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>
|
||||
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
|
||||
<DevelopmentDependency>true</DevelopmentDependency>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<!--
|
||||
If 'true' (the default), build projects referenced in @(OpenApiProjectReference) items before retrieving that
|
||||
project's Open API documents list (or generating code). If 'false', ensure the referenced projects build before
|
||||
project's OpenAPI documents list (or generating code). If 'false', ensure the referenced projects build before
|
||||
this one in the solution or through other means. IDEs may be confused about the project dependency graph in this
|
||||
case.
|
||||
-->
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
Condition="'$(OpenApiBuildReferencedProjects)' == ''">true</OpenApiBuildReferencedProjects>
|
||||
|
||||
<!--
|
||||
Default folder to place code generated from Open API documents. Value is interpreted relative to the project
|
||||
Default folder to place code generated from OpenAPI documents. Value is interpreted relative to the project
|
||||
folder, unless already an absolute path. Part of the default %(OutputPath) metadata of @(OpenApiReference) and
|
||||
@(OpenApiProjectReference) items.
|
||||
-->
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@
|
|||
Condition="$(OpenApiGenerateCodeAtDesignTime) OR ('$(DesignTimeBuild)' != 'true' AND '$(BuildingProject)' == 'true')"
|
||||
Inputs="@(OpenApiReference)"
|
||||
Outputs="%(OutputPath)">
|
||||
<Error Condition="!Exists('%(OpenApiReference.FullPath)')" Text="Input OpenAPI file %(Identity) does not exist." />
|
||||
|
||||
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
||||
BuildInParallel="$(BuildInParallel)"
|
||||
Properties="GeneratorTargetPath=%(OpenApiReference.OutputPath);GeneratorTarget=Generate%(CodeGenerator);GeneratorMetadata=%(SerializedMetadata)"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<HasReferenceAssembly>false</HasReferenceAssembly>
|
||||
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
|
||||
<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>
|
||||
<DevelopmentDependency>true</DevelopmentDependency>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
-->
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
Options added to the Open API document generation tool ('dotnet-getdocument') command line. Available options
|
||||
Options added to the OpenAPI document generation tool ('dotnet-getdocument') command line. Available options
|
||||
control console output: 'no-color', 'prefix-output' and 'verbose'. All require a double-dash prefix.
|
||||
-->
|
||||
<OpenApiGenerateDocumentsOptions Condition=" '$(OpenApiGenerateDocumentsOptions)' == '' " />
|
||||
|
||||
<!--
|
||||
If 'true' (the default when targeting .NET Framework or .NET Core 2.1 and later), enable generation of Open API
|
||||
If 'true' (the default when targeting .NET Framework or .NET Core 2.1 and later), enable generation of OpenAPI
|
||||
documents. Otherwise, this feature is completely disabled. This controls whether the 'OpenApiGenerateDocuments'
|
||||
project capability is visible, enables / disables the 'GenerateOpenApiDocuments' target and provides the
|
||||
$(OpenApiGenerateDocumentsOnBuild) default.
|
||||
|
|
@ -19,13 +19,13 @@
|
|||
<OpenApiGenerateDocuments Condition=" '$(OpenApiGenerateDocuments)' == '' " />
|
||||
|
||||
<!--
|
||||
If 'true' (the default if $(OpenApiGenerateDocuments) is 'true'), will generate Open API documents after every
|
||||
If 'true' (the default if $(OpenApiGenerateDocuments) is 'true'), will generate OpenAPI documents after every
|
||||
build. Set to 'false' when targets are invoked from the command line or tied to another target.
|
||||
-->
|
||||
<OpenApiGenerateDocumentsOnBuild Condition=" '$(OpenApiGenerateDocumentsOnBuild)' == '' " />
|
||||
|
||||
<!--
|
||||
Where to place Open API documents generated from the application. Value is interpreted relative to the project
|
||||
Where to place OpenAPI documents generated from the application. Value is interpreted relative to the project
|
||||
folder, unless already an absolute path.
|
||||
-->
|
||||
<OpenApiDocumentsDirectory
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project>
|
||||
<PropertyGroup Condition=" '$(OpenApiGenerateDocuments)' == '' ">
|
||||
<OpenApiGenerateDocuments>true</OpenApiGenerateDocuments>
|
||||
<OpenApiGenerateDocuments
|
||||
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(TargetFrameworkVersion.TrimStart("vV"))' < '2.1' ">false</OpenApiGenerateDocuments>
|
||||
<OpenApiGenerateDocuments Condition=" '$(OpenApiGenerateDocuments)' == '' ">true</OpenApiGenerateDocuments>
|
||||
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(TargetFrameworkVersion.TrimStart("vV"))' < '2.1' " />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(OpenApiGenerateDocumentsOnBuild)' == '' ">
|
||||
<OpenApiGenerateDocumentsOnBuild>$(OpenApiGenerateDocuments)</OpenApiGenerateDocumentsOnBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<_OpenApiDocumentsCache>$(BaseIntermediateOutputPath)$(MSBuildProjectName).OpenApiFiles.cache</_OpenApiDocumentsCache>
|
||||
<OpenApiGenerateDocumentsOnBuild
|
||||
Condition=" '$(OpenApiGenerateDocumentsOnBuild)' == '' ">$(OpenApiGenerateDocuments)</OpenApiGenerateDocumentsOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(OpenApiGenerateDocuments)' == 'true' ">
|
||||
|
|
@ -16,23 +17,34 @@
|
|||
</ItemGroup>
|
||||
|
||||
<Target Name="OpenApiGetDocuments" Returns="@(_OpenApiProjectDocuments)">
|
||||
<Error Text="OpenAPI document generation is disabled. Add '<OpenApiGenerateDocuments>true</OpenApiGenerateDocuments>' to the project."
|
||||
Condition=" '$(OpenApiGenerateDocuments)' != 'true' " />
|
||||
<!-- E.g. a client project has @(OpenApiProjectReference) item for project that does not support doc generation. -->
|
||||
<Error Condition=" '$(OpenApiGenerateDocuments)' != 'true' "
|
||||
Text="OpenAPI document generation is disabled. Add '<OpenApiGenerateDocuments>true</OpenApiGenerateDocuments>' to the project." />
|
||||
<!-- E.g. project set $(OpenApiGenerateDocuments) to 'true' but TFM is not supported. -->
|
||||
<Error
|
||||
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(TargetFrameworkVersion.TrimStart("vV"))' < '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 '<OpenApiGenerateDocumentsOnBuild>true</OpenApiGenerateDocumentsOnBuild>' to the project or call the GenerateOpenApiDocuments target." />
|
||||
|
||||
<ReadLinesFromFile File="$(_OpenApiDocumentsCache)">
|
||||
<Output TaskParameter="Lines" ItemName="_OpenApiProjectDocuments" />
|
||||
</ReadLinesFromFile>
|
||||
|
||||
<Warning Text="Application does not have any registered documents. Update its 'Startup' class to register a document."
|
||||
Condition=" '@(_OpenApiProjectDocuments)' == '' " />
|
||||
<!-- Fallback error in case something slips through the insider's error checking. -->
|
||||
<Error Condition=" '@(_OpenApiProjectDocuments)' == '' "
|
||||
Text="Application does not have any registered documents. Update its 'Startup' class to register a document." />
|
||||
</Target>
|
||||
|
||||
<Target Name="GenerateOpenApiDocuments"
|
||||
Condition=" '$(OpenApiGenerateDocuments)' == 'true' "
|
||||
Inputs="$(TargetPath)"
|
||||
Outputs="$(_OpenApiDocumentsCache)">
|
||||
<Error Text="OpenAPI document generation is not supported when targeting netcoreapp2.0 or earlier. Disable the feature or move to a later target framework."
|
||||
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(TargetFrameworkVersion.TrimStart("vV"))' < '2.1' " />
|
||||
<Target Name="GenerateOpenApiDocuments" Inputs="$(TargetPath)" Outputs="$(_OpenApiDocumentsCache)">
|
||||
<!-- E.g. project sets $(OpenApiGenerateDocumentsOnBuild) to 'true' but $(OpenApiGenerateDocuments) is 'false'. -->
|
||||
<Error Condition=" '$(OpenApiGenerateDocuments)' != 'true' "
|
||||
Text="OpenAPI document generation is disabled. Add '<OpenApiGenerateDocuments>true</OpenApiGenerateDocuments>' to the project." />
|
||||
<!-- E.g. project sets $(OpenApiGenerateDocuments) to 'true' but TFM is not supported. -->
|
||||
<Error
|
||||
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(TargetFrameworkVersion.TrimStart("vV"))' < '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>
|
||||
<_Command>dotnet "$(MSBuildThisFileDirectory)/../tools/dotnet-getdocument.dll" --assembly "$(TargetPath)"</_Command>
|
||||
|
|
@ -47,7 +59,7 @@
|
|||
|
||||
<Message Importance="high" Text="%0AGenerateOpenApiDocuments:" />
|
||||
<Message Importance="high" Text=" $(_Command)" />
|
||||
<Exec Command="$(_Command)" />
|
||||
<Exec Command="$(_Command)" LogStandardErrorAsError="true" />
|
||||
</Target>
|
||||
|
||||
<!-- Unless this is an inner build or default timing is disabled, tie document retrieval into the build. -->
|
||||
|
|
|
|||
|
|
@ -1,9 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project>
|
||||
<ItemGroup>
|
||||
<_OpenApiGenerateDocumentsTFMs Remove="@(_OpenApiGenerateDocumentsTFMs)" />
|
||||
<_OpenApiGenerateDocumentsTFMs Include="$(TargetFrameworks)" Exclude="netcoreapp1.0;netcoreapp1.1;netcoreapp2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<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
|
||||
Condition=" '$(OpenApiGenerateDocumentsOnBuild)' == '' ">$(OpenApiGenerateDocuments)</OpenApiGenerateDocumentsOnBuild>
|
||||
|
||||
<_Temporary />
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(OpenApiGenerateDocuments)' == 'true' ">
|
||||
|
|
@ -13,7 +29,7 @@
|
|||
<Target Name="GenerateOpenApiDocuments">
|
||||
<MSBuild Projects="$(MSBuildProjectFile)"
|
||||
Targets="GenerateOpenApiDocuments"
|
||||
Properties="TargetFramework=$(TargetFrameworks.Split(';')[0])"
|
||||
Properties="TargetFramework=$(_OpenApiGenerateDocumentsTFM)"
|
||||
RemoveProperties="RuntimeIdentifier" />
|
||||
</Target>
|
||||
|
||||
|
|
@ -23,27 +39,11 @@
|
|||
DependsOnTargets="GenerateOpenApiDocuments" />
|
||||
|
||||
<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)"
|
||||
Targets="OpenApiGetDocuments"
|
||||
Condition=" '$(_Temporary)' != '' "
|
||||
Properties="TargetFramework=$(_Temporary.Split(';')[0])"
|
||||
Properties="TargetFramework=$(_OpenApiGenerateDocumentsTFM)"
|
||||
RemoveProperties="RuntimeIdentifier">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="_OpenApiProjectDocuments" />
|
||||
</MSBuild>
|
||||
|
||||
<ItemGroup>
|
||||
<_Temporary Remove="@(_Temporary)" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<_Temporary />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ namespace Microsoft.Extensions.ApiDescription.Tool.Commands
|
|||
}
|
||||
|
||||
// Write out the documents.
|
||||
var found = false;
|
||||
Directory.CreateDirectory(context.OutputDirectory);
|
||||
var filePathList = new List<string>();
|
||||
foreach (var documentName in documentNames)
|
||||
|
|
@ -153,6 +154,7 @@ namespace Microsoft.Extensions.ApiDescription.Tool.Commands
|
|||
}
|
||||
|
||||
filePathList.Add(filePath);
|
||||
found = true;
|
||||
}
|
||||
|
||||
// Write out the cache file.
|
||||
|
|
@ -160,7 +162,12 @@ namespace Microsoft.Extensions.ApiDescription.Tool.Commands
|
|||
using var writer = new StreamWriter(stream);
|
||||
writer.WriteLine(string.Join(Environment.NewLine, filePathList));
|
||||
|
||||
return true;
|
||||
if (!found)
|
||||
{
|
||||
Reporter.WriteError(Resources.DocumentsNotFound);
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
private static string GetDocument(
|
||||
|
|
|
|||
|
|
@ -33,15 +33,13 @@ namespace Microsoft.Extensions.ApiDescription.Tool
|
|||
{
|
||||
if (ex is CommandException || ex is CommandParsingException)
|
||||
{
|
||||
Reporter.WriteVerbose(ex.ToString());
|
||||
Reporter.WriteError(ex.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Reporter.WriteInformation(ex.ToString());
|
||||
Reporter.WriteError(ex.ToString());
|
||||
}
|
||||
|
||||
Reporter.WriteError(ex.Message);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ namespace Microsoft.Extensions.ApiDescription.Tool
|
|||
{
|
||||
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 NoColor { get; set; }
|
||||
public static bool PrefixOutput { get; set; }
|
||||
|
|
@ -17,7 +20,7 @@ namespace Microsoft.Extensions.ApiDescription.Tool
|
|||
=> NoColor ? value : colorizeFunc(value);
|
||||
|
||||
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)
|
||||
=> WriteLine(Prefix("warn: ", Colorize(message, x => Bold + Yellow + x + Reset)));
|
||||
|
|
@ -32,7 +35,7 @@ namespace Microsoft.Extensions.ApiDescription.Tool
|
|||
{
|
||||
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;
|
||||
|
||||
private static void WriteLine(string value)
|
||||
private static void WriteLine(string value, bool isError = false)
|
||||
{
|
||||
if (NoColor)
|
||||
{
|
||||
Console.WriteLine(value);
|
||||
(isError ? Console.Error : Console.Out).WriteLine(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AnsiConsole.WriteLine(value);
|
||||
(isError ? Error : Out).WriteLine(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,7 +151,8 @@
|
|||
<value>Method '{0}' not found in type '{1}' with expected signature.</value>
|
||||
</data>
|
||||
<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 name="MethodReturnedNull" xml:space="preserve">
|
||||
<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">
|
||||
<value>Unable to resolve a non-null '{0}' implementation using method '{1}', '{2}' or '{3}' of type '{4}'.</value>
|
||||
</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>
|
||||
|
|
@ -2,70 +2,74 @@
|
|||
"solution": {
|
||||
"path": "Mvc.sln",
|
||||
"projects": [
|
||||
"test\\WebSites\\BasicWebSite\\BasicWebSite.csproj",
|
||||
"test\\WebSites\\RoutingWebSite\\Mvc.RoutingWebSite.csproj",
|
||||
"test\\WebSites\\RazorWebSite\\RazorWebSite.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\\test\\Microsoft.AspNetCore.Mvc.Abstractions.Test.csproj",
|
||||
"Mvc.ApiExplorer\\src\\Microsoft.AspNetCore.Mvc.ApiExplorer.csproj",
|
||||
"Mvc.ApiExplorer\\test\\Microsoft.AspNetCore.Mvc.ApiExplorer.Test.csproj",
|
||||
"Mvc.Core\\src\\Microsoft.AspNetCore.Mvc.Core.csproj",
|
||||
"Mvc.Core\\test\\Microsoft.AspNetCore.Mvc.Core.Test.csproj",
|
||||
"Mvc.Cors\\src\\Microsoft.AspNetCore.Mvc.Cors.csproj",
|
||||
"Mvc.Cors\\test\\Microsoft.AspNetCore.Mvc.Cors.Test.csproj",
|
||||
"Mvc.DataAnnotations\\src\\Microsoft.AspNetCore.Mvc.DataAnnotations.csproj",
|
||||
"Mvc.DataAnnotations\\test\\Microsoft.AspNetCore.Mvc.DataAnnotations.Test.csproj",
|
||||
"Mvc.Formatters.Json\\src\\Microsoft.AspNetCore.Mvc.Formatters.Json.csproj",
|
||||
"Mvc.Formatters.Xml\\src\\Microsoft.AspNetCore.Mvc.Formatters.Xml.csproj",
|
||||
"Mvc.Formatters.Xml\\test\\Microsoft.AspNetCore.Mvc.Formatters.Xml.Test.csproj",
|
||||
"Mvc.Localization\\src\\Microsoft.AspNetCore.Mvc.Localization.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\\test\\Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test.csproj",
|
||||
"Mvc.Razor.RuntimeCompilation\\src\\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj",
|
||||
"Mvc.Razor.RuntimeCompilation\\test\\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test.csproj",
|
||||
"test\\WebSites\\RazorBuildWebSite.PrecompiledViews\\RazorBuildWebSite.PrecompiledViews.csproj"
|
||||
"Extensions.ApiDescription.Client\\src\\Microsoft.Extensions.ApiDescription.Client.csproj",
|
||||
"Extensions.ApiDescription.Server\\src\\Microsoft.Extensions.ApiDescription.Server.csproj",
|
||||
"GetDocumentInsider\\src\\GetDocumentInsider.csproj",
|
||||
"Mvc.Abstractions\\src\\Microsoft.AspNetCore.Mvc.Abstractions.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\\test\\Microsoft.AspNetCore.Mvc.ApiExplorer.Test.csproj",
|
||||
"Mvc.Core\\src\\Microsoft.AspNetCore.Mvc.Core.csproj",
|
||||
"Mvc.Core\\test\\Microsoft.AspNetCore.Mvc.Core.Test.csproj",
|
||||
"Mvc.Cors\\src\\Microsoft.AspNetCore.Mvc.Cors.csproj",
|
||||
"Mvc.Cors\\test\\Microsoft.AspNetCore.Mvc.Cors.Test.csproj",
|
||||
"Mvc.DataAnnotations\\src\\Microsoft.AspNetCore.Mvc.DataAnnotations.csproj",
|
||||
"Mvc.DataAnnotations\\test\\Microsoft.AspNetCore.Mvc.DataAnnotations.Test.csproj",
|
||||
"Mvc.Formatters.Json\\src\\Microsoft.AspNetCore.Mvc.Formatters.Json.csproj",
|
||||
"Mvc.Formatters.Xml\\src\\Microsoft.AspNetCore.Mvc.Formatters.Xml.csproj",
|
||||
"Mvc.Formatters.Xml\\test\\Microsoft.AspNetCore.Mvc.Formatters.Xml.Test.csproj",
|
||||
"Mvc.Localization\\src\\Microsoft.AspNetCore.Mvc.Localization.csproj",
|
||||
"Mvc.Localization\\test\\Microsoft.AspNetCore.Mvc.Localization.Test.csproj",
|
||||
"Mvc.NewtonsoftJson\\src\\Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj",
|
||||
"Mvc.NewtonsoftJson\\test\\Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test.csproj",
|
||||
"Mvc.Razor.RuntimeCompilation\\src\\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj",
|
||||
"Mvc.Razor.RuntimeCompilation\\test\\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test.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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -27,15 +27,13 @@ namespace Microsoft.Extensions.ApiDescription.Tool
|
|||
{
|
||||
if (ex is CommandException || ex is CommandParsingException)
|
||||
{
|
||||
Reporter.WriteVerbose(ex.ToString());
|
||||
Reporter.WriteError(ex.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Reporter.WriteInformation(ex.ToString());
|
||||
Reporter.WriteError(ex.ToString());
|
||||
}
|
||||
|
||||
Reporter.WriteError(ex.Message);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue