diff --git a/Docs/API.md b/Docs/API.md index ae60b4090..7a59954d5 100644 --- a/Docs/API.md +++ b/Docs/API.md @@ -27,6 +27,7 @@ The ASP.NET Core API project template uses `dotnet new` to enable you to turn fe - **Title** - The name of the project which determines the assembly product name. If the Swagger feature is enabled, shows the title on the Swagger UI. - **Description** - A description of the project which determines the assembly description. If the Swagger feature is enabled, shows the description on the Swagger UI. - **Author** - The name of the author of the project which determines the assembly author and copyright information. +- **TreatWarningsAsErrors** - Treat warnings as errors. - **HttpPort** - Port number to use for the HTTP endpoint in launchSettings.json. - **HttpsPort** - Port number to use for the HTTPS endpoint in launchSettings.json. diff --git a/Docs/GraphQL.md b/Docs/GraphQL.md index 324505d96..ba735b4ff 100644 --- a/Docs/GraphQL.md +++ b/Docs/GraphQL.md @@ -22,6 +22,7 @@ The ASP.NET Core GraphQL project template uses `dotnet new` to enable you to tur - **Title** - The name of the project which determines the assembly product name. - **Description** - A description of the project which determines the assembly description. - **Author** - The name of the author of the project which determines the assembly author and copyright information. +- **TreatWarningsAsErrors** - Treat warnings as errors. - **HttpPort** - Port number to use for the HTTP endpoint in launchSettings.json. - **HttpsPort** - Port number to use for the HTTPS endpoint in launchSettings.json. diff --git a/Source/Content/ApiTemplate/.template.config/dotnetcli.host.json b/Source/Content/ApiTemplate/.template.config/dotnetcli.host.json index 9da35d4ae..2044f141d 100644 --- a/Source/Content/ApiTemplate/.template.config/dotnetcli.host.json +++ b/Source/Content/ApiTemplate/.template.config/dotnetcli.host.json @@ -19,6 +19,9 @@ "AuthorXmlEncoded": { "isHidden": true }, + "TreatWarningsAsErrors": { + "longName": "treat-warnings-as-errors" + }, "Swagger": { "longName": "swagger" }, diff --git a/Source/Content/ApiTemplate/.template.config/template.json b/Source/Content/ApiTemplate/.template.config/template.json index d28145c8b..40aad83f7 100644 --- a/Source/Content/ApiTemplate/.template.config/template.json +++ b/Source/Content/ApiTemplate/.template.config/template.json @@ -141,6 +141,13 @@ "valueSource": "Author", "valueTransform": "xmlEncode" }, + // TreatWarningsAsErrors + "TreatWarningsAsErrors": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "true", + "description": "Treat warnings as errors." + }, // Swagger "Swagger": { diff --git a/Source/Content/ApiTemplate/ApiTemplate.csproj b/Source/Content/ApiTemplate/ApiTemplate.csproj index bdbf72a29..1cef5b567 100644 --- a/Source/Content/ApiTemplate/ApiTemplate.csproj +++ b/Source/Content/ApiTemplate/ApiTemplate.csproj @@ -1,8 +1,8 @@ - + - $(DefineConstants);Kestrel;IIS;NGINX;Azure;ApplicationInsights;HealthCheck;HttpsEverywhere;HstsPreload;ForwardedHeaders;HostFiltering;ResponseCaching;ResponseCompression;CORS;HumansTxt;RobotsTxt;Swagger;Versioning;DataContractSerializer;CorrelationId + $(DefineConstants);TreatWarningsAsErrors;Kestrel;IIS;NGINX;Azure;ApplicationInsights;HealthCheck;HttpsEverywhere;HstsPreload;ForwardedHeaders;HostFiltering;ResponseCaching;ResponseCompression;CORS;HumansTxt;RobotsTxt;Swagger;Versioning;DataContractSerializer;CorrelationId true true @@ -32,6 +32,7 @@ true + true diff --git a/Source/Content/GraphQLTemplate/.template.config/dotnetcli.host.json b/Source/Content/GraphQLTemplate/.template.config/dotnetcli.host.json index ee9c3b29b..62e782cf0 100644 --- a/Source/Content/GraphQLTemplate/.template.config/dotnetcli.host.json +++ b/Source/Content/GraphQLTemplate/.template.config/dotnetcli.host.json @@ -19,6 +19,9 @@ "AuthorXmlEncoded": { "isHidden": true }, + "TreatWarningsAsErrors": { + "longName": "treat-warnings-as-errors" + }, "Mutations": { "longName": "mutations" }, diff --git a/Source/Content/GraphQLTemplate/.template.config/template.json b/Source/Content/GraphQLTemplate/.template.config/template.json index 6169ab300..8a5147359 100644 --- a/Source/Content/GraphQLTemplate/.template.config/template.json +++ b/Source/Content/GraphQLTemplate/.template.config/template.json @@ -132,6 +132,13 @@ "valueSource": "Author", "valueTransform": "xmlEncode" }, + // TreatWarningsAsErrors + "TreatWarningsAsErrors": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "true", + "description": "Treat warnings as errors." + }, // Mutations "Mutations": { diff --git a/Source/Content/GraphQLTemplate/GraphQLTemplate.csproj b/Source/Content/GraphQLTemplate/GraphQLTemplate.csproj index a18e83a67..7252645b1 100644 --- a/Source/Content/GraphQLTemplate/GraphQLTemplate.csproj +++ b/Source/Content/GraphQLTemplate/GraphQLTemplate.csproj @@ -1,8 +1,8 @@ - + - $(DefineConstants);Mutations;Subscriptions;Kestrel;IIS;NGINX;Azure;ApplicationInsights;HealthCheck;HttpsEverywhere;HstsPreload;ForwardedHeaders;HostFiltering;ResponseCaching;CORS;HumansTxt;RobotsTxt;CorrelationId;ResponseCompression + $(DefineConstants);TreatWarningsAsErrors;Mutations;Subscriptions;Kestrel;IIS;NGINX;Azure;ApplicationInsights;HealthCheck;HttpsEverywhere;HstsPreload;ForwardedHeaders;HostFiltering;ResponseCaching;CORS;HumansTxt;RobotsTxt;CorrelationId;ResponseCompression true true @@ -25,6 +25,7 @@ true + true