diff --git a/.github/prompts/error-consolidation.md b/.github/prompts/error-consolidation.md index 6fc5e79dfadd6..65ec8247348d2 100644 --- a/.github/prompts/error-consolidation.md +++ b/.github/prompts/error-consolidation.md @@ -64,7 +64,7 @@ Understand these instructions, then suggest a list of themes and the included er ## Move from description to resolution -Rework the highlighted section so the focus is on how to correct each error. This article doesn't need to explain the associated language feature. Instead, in each section, provide links to language reference or language specification material that explains the rules violated when these diagnostics appear. Add explanatory context after each correction (in parentheses with the error code). Provided brief reasons why each correction is needed. Use detailed, sentence-style explanations rather than brief imperative statements. For each recommendation put the affectived error codes in parentheses, and in **bold** style. Remove extensive examples. Remove all H3 headings in this section. If any errors are no longer produced in the latest version of C#, make a note of that. +Rework the highlighted section so the focus is on how to correct each error. This article doesn't need to explain the associated language feature. Instead, in each section, provide links to language reference or language specification material that explains the rules violated when these diagnostics appear. Add explanatory context after each correction (in parentheses with the error code). Provided brief reasons why each correction is needed. Use detailed, sentence-style explanations rather than brief imperative statements. For each recommendation put the affected error codes in parentheses, and in **bold** style. Remove extensive examples. Remove all H3 headings in this section. If any errors are no longer produced in the latest version of C#, make a note of that. ## Verify error messages diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md index 4c59cc56dc51e..c403bb38962e0 100644 --- a/docs/azure/includes/dotnet-all.md +++ b/docs/azure/includes/dotnet-all.md @@ -118,8 +118,8 @@ | unknown | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Azure.AI.AgentServer.AgentFramework/1.0.0-beta.5) | [docs](/dotnet/api/overview/azure/AI.AgentServer.AgentFramework-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.AgentServer.AgentFramework_1.0.0-beta.5/sdk/agentserver/Azure.AI.AgentServer.AgentFramework/) | | unknown | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Azure.AI.AgentServer.Contracts/1.0.0-beta.5) | [docs](/dotnet/api/overview/azure/AI.AgentServer.Contracts-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.AgentServer.Contracts_1.0.0-beta.5/sdk/agentserver/Azure.AI.AgentServer.Contracts/) | | unknown | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Azure.AI.AgentServer.Core/1.0.0-beta.5) | [docs](/dotnet/api/overview/azure/AI.AgentServer.Core-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.AgentServer.Core_1.0.0-beta.5/sdk/agentserver/Azure.AI.AgentServer.Core/) | -| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Language.QuestionAnswering.Authoring/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Language.QuestionAnswering.Authoring_1.0.0-beta.1/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/) | -| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Language.QuestionAnswering.Inference/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Language.QuestionAnswering.Inference_1.0.0-beta.1/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Inference/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Language.QuestionAnswering.Authoring/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.Language.QuestionAnswering.Authoring-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Language.QuestionAnswering.Authoring_1.0.0-beta.1/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Language.QuestionAnswering.Inference/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.Language.QuestionAnswering.Inference-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Language.QuestionAnswering.Inference_1.0.0-beta.1/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Inference/) | | unknown | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.AI.Projects.OpenAI/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/AI.Projects.OpenAI-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Projects.OpenAI_1.0.0-beta.4/sdk/ai/Azure.AI.Projects.OpenAI/) | | Vision Common | NuGet [0.15.1-beta.1](https://www.nuget.org/packages/Azure.AI.Vision.Common/0.15.1-beta.1) | | GitHub [0.15.1-beta.1](https://msasg.visualstudio.com/Skyman/_git/Carbon) | | Voice Live | NuGet [1.0.0](https://www.nuget.org/packages/Azure.AI.VoiceLive/1.0.0)
NuGet [1.1.0-beta.1](https://www.nuget.org/packages/Azure.AI.VoiceLive/1.1.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.VoiceLive-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.VoiceLive_1.0.0/sdk/ai/Azure.AI.VoiceLive/)
GitHub [1.1.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.VoiceLive_1.1.0-beta.1/sdk/ai/Azure.AI.VoiceLive/) | @@ -557,7 +557,7 @@ | Functions extension for RabbitMQ | NuGet [2.1.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.RabbitMQ/2.1.0) | | GitHub [2.1.0](https://github.com/Azure/azure-functions-rabbitmq-extension/tree/v0.2.2029-beta) | | Functions extension for script abstractions | NuGet [1.0.4-preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Script.Abstractions/1.0.4-preview) | | | | Functions extension for SendGrid | NuGet [3.1.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.SendGrid/3.1.1) | | GitHub [3.1.1](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/v3.0.0/src/WebJobs.Extensions.SendGrid) | -| Functions extension for Sources | NuGet [3.0.43](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Sources/3.0.43) | | GitHub [3.0.43](https://github.com/Azure/azure-webjobs-sdk) | +| Functions extension for Sources | NuGet [3.0.44](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Sources/3.0.44) | | GitHub [3.0.44](https://github.com/Azure/azure-webjobs-sdk) | | Functions extension for Storage Timers | NuGet [1.1.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Timers.Storage/1.1.0) | | | | Functions extension for Twilio | NuGet [3.0.2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Twilio/3.0.2) | | GitHub [3.0.2](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/v3.0.0/src/WebJobs.Extensions.Twilio) | | Functions extension metadata generator | NuGet [4.0.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator/4.0.1) | | GitHub [4.0.1](https://github.com/Azure/azure-functions-host) | @@ -572,9 +572,9 @@ | Functions OpenAPI app settings deserialization library | NuGet [1.4.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.OpenApi.Configuration.AppSettings/1.4.0)
NuGet [2.0.0-preview2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.OpenApi.Configuration.AppSettings/2.0.0-preview2) | | | | Functions OpenAPI document and Swagger UI renderer library | NuGet [1.4.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.OpenApi/1.4.0)
NuGet [2.0.0-preview2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.OpenApi/2.0.0-preview2) | | | | Functions project template pack for Microsoft Template Engine | NuGet [4.0.5337](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.ProjectTemplates/4.0.5337) | | GitHub [4.0.5337](https://github.com/Azure/azure-functions-templates/tree/3.1.1582) | -| Functions runtime assemblies for App Insights logging | NuGet [3.0.41](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Logging.ApplicationInsights/3.0.41) | | GitHub [3.0.41](https://github.com/Azure/azure-webjobs-sdk/tree/v3.0.18/src/Microsoft.Azure.WebJobs.Logging.ApplicationInsights) | +| Functions runtime assemblies for App Insights logging | NuGet [3.0.44](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Logging.ApplicationInsights/3.0.44) | | GitHub [3.0.44](https://github.com/Azure/azure-webjobs-sdk/tree/v3.0.18/src/Microsoft.Azure.WebJobs.Logging.ApplicationInsights) | | Functions runtime assemblies for logging | NuGet [4.0.3](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Logging/4.0.3) | | | -| Functions runtime assemblies for Microsoft.Azure.WebJobs.Host | NuGet [3.0.43](https://www.nuget.org/packages/Microsoft.Azure.WebJobs/3.0.43) | | GitHub [3.0.43](https://github.com/Azure/azure-webjobs-sdk/tree/v3.0.18/src/Microsoft.Azure.WebJobs) | +| Functions runtime assemblies for Microsoft.Azure.WebJobs.Host | NuGet [3.0.44](https://www.nuget.org/packages/Microsoft.Azure.WebJobs/3.0.44) | | GitHub [3.0.44](https://github.com/Azure/azure-webjobs-sdk/tree/v3.0.18/src/Microsoft.Azure.WebJobs) | | Functions timers and file triggers | NuGet [5.2.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions/5.2.1) | | GitHub [5.2.1](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/dev/src/WebJobs.Extensions) | | Microsoft.Azure.Cosmos.Templates | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Templates/1.0.0) | | | | Microsoft.Azure.Functions.Analyzers | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Analyzers/1.0.0) | | | @@ -612,8 +612,8 @@ | Microsoft.Azure.Functions.Worker.Sdk.Generators | NuGet [1.3.6](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk.Generators/1.3.6) | | | | Microsoft.Azure.WebJobs.CosmosDb.ChangeProcessor | NuGet [1.0.4](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.CosmosDb.ChangeProcessor/1.0.4) | | | | Microsoft.Azure.WebJobs.Extensions.Kusto | NuGet [1.0.13-Preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Kusto/1.0.13-Preview) | | | -| Microsoft.Azure.WebJobs.Extensions.Rpc | NuGet [3.0.43](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Rpc/3.0.43) | | | -| Microsoft.Azure.WebJobs.Rpc.Core | NuGet [3.0.43](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Rpc.Core/3.0.43) | | | +| Microsoft.Azure.WebJobs.Extensions.Rpc | NuGet [3.0.44](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Rpc/3.0.44) | | | +| Microsoft.Azure.WebJobs.Rpc.Core | NuGet [3.0.44](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Rpc.Core/3.0.44) | | | | Service Bus - Message ID plugin | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.ServiceBus.MessageIdPlugin/2.0.0) | | | | SignalR | NuGet [1.32.0](https://www.nuget.org/packages/Microsoft.Azure.SignalR/1.32.0)
NuGet [1.25.0-preview1-11147](https://www.nuget.org/packages/Microsoft.Azure.SignalR/1.25.0-preview1-11147) | | GitHub [1.32.0](https://github.com/Azure/azure-signalr/tree/v1.5.0/src/Microsoft.Azure.SignalR) | | SignalR - ASP.NET | NuGet [1.32.0](https://www.nuget.org/packages/Microsoft.Azure.SignalR.AspNet/1.32.0) | | GitHub [1.32.0](https://github.com/Azure/azure-signalr/tree/v1.5.0/src/Microsoft.Azure.SignalR.AspNet) | @@ -625,9 +625,9 @@ | SQL Database Elastic Scale Service SplitMerge | NuGet [1.2.0](https://www.nuget.org/packages/Microsoft.Azure.SqlDatabase.ElasticScale.Service.SplitMerge/1.2.0) | | | | SQL Database Jobs | NuGet [0.8.3362.1](https://www.nuget.org/packages/Microsoft.Azure.SqlDatabase.Jobs/0.8.3362.1) | | | | Storage APIs for Microsoft.Azure.WebJobs.Host | NuGet [5.0.2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Host.Storage/5.0.2) | | GitHub [5.0.2](https://github.com/Azure/azure-webjobs-sdk/tree/storage-v4.0.1/src/Microsoft.Azure.WebJobs.Host.Storage) | -| Supporting library for Microsoft.Azure.WebJobs | NuGet [3.0.43](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Core/3.0.43) | | GitHub [3.0.43](https://github.com/Azure/azure-webjobs-sdk/tree/v3.0.18) | +| Supporting library for Microsoft.Azure.WebJobs | NuGet [3.0.44](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Core/3.0.44) | | GitHub [3.0.44](https://github.com/Azure/azure-webjobs-sdk/tree/v3.0.18) | | Supporting library for Microsoft.Azure.WebJobs.Extensions.OpenApi | NuGet [1.4.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/1.4.0)
NuGet [2.0.0-preview2](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/2.0.0-preview2) | | | -| Supporting library for testing Microsoft.Azure.WebJobs.Host | NuGet [3.0.43](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Host.TestCommon/3.0.43) | | GitHub [3.0.43](https://github.com/Azure/azure-webjobs-sdk) | +| Supporting library for testing Microsoft.Azure.WebJobs.Host | NuGet [3.0.44](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Host.TestCommon/3.0.44) | | GitHub [3.0.44](https://github.com/Azure/azure-webjobs-sdk) | | Web - Redis Output Cache Provider | NuGet [4.0.1](https://www.nuget.org/packages/Microsoft.Web.RedisOutputCacheProvider/4.0.1) | | GitHub [4.0.1](https://github.com/Azure/aspnet-redis-providers/tree/NuGet-Release/RedisOutputCacheProvider-3.0.1/src/OutputCacheProvider) | | Web - Redis Session State Provider | NuGet [5.0.4](https://www.nuget.org/packages/Microsoft.Web.RedisSessionStateProvider/5.0.4) | | GitHub [5.0.4](https://github.com/Azure/aspnet-redis-providers/tree/NuGet-Release/RedisSessionStateProvider-4.0.1/src/RedisSessionStateProvider) | | Hyak Common | NuGet [1.2.2](https://www.nuget.org/packages/Hyak.Common/1.2.2) | | | diff --git a/docs/azure/includes/dotnet-new.md b/docs/azure/includes/dotnet-new.md index 97b2956489df6..210d16e8b6790 100644 --- a/docs/azure/includes/dotnet-new.md +++ b/docs/azure/includes/dotnet-new.md @@ -127,8 +127,8 @@ | unknown | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Azure.AI.AgentServer.AgentFramework/1.0.0-beta.5) | [docs](/dotnet/api/overview/azure/AI.AgentServer.AgentFramework-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.AgentServer.AgentFramework_1.0.0-beta.5/sdk/agentserver/Azure.AI.AgentServer.AgentFramework/) | | unknown | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Azure.AI.AgentServer.Contracts/1.0.0-beta.5) | [docs](/dotnet/api/overview/azure/AI.AgentServer.Contracts-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.AgentServer.Contracts_1.0.0-beta.5/sdk/agentserver/Azure.AI.AgentServer.Contracts/) | | unknown | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Azure.AI.AgentServer.Core/1.0.0-beta.5) | [docs](/dotnet/api/overview/azure/AI.AgentServer.Core-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.AgentServer.Core_1.0.0-beta.5/sdk/agentserver/Azure.AI.AgentServer.Core/) | -| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Language.QuestionAnswering.Authoring/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Language.QuestionAnswering.Authoring_1.0.0-beta.1/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/) | -| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Language.QuestionAnswering.Inference/1.0.0-beta.1) | | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Language.QuestionAnswering.Inference_1.0.0-beta.1/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Inference/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Language.QuestionAnswering.Authoring/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.Language.QuestionAnswering.Authoring-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Language.QuestionAnswering.Authoring_1.0.0-beta.1/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/) | +| unknown | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Language.QuestionAnswering.Inference/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.Language.QuestionAnswering.Inference-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Language.QuestionAnswering.Inference_1.0.0-beta.1/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Inference/) | | unknown | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.AI.Projects.OpenAI/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/AI.Projects.OpenAI-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Projects.OpenAI_1.0.0-beta.4/sdk/ai/Azure.AI.Projects.OpenAI/) | | Video Analyzer Edge | NuGet [1.0.0-beta.6](https://www.nuget.org/packages/Azure.Media.VideoAnalyzer.Edge/1.0.0-beta.6) | [docs](/dotnet/api/overview/azure/Media.VideoAnalyzer.Edge-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.6](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Media.VideoAnalyzer.Edge_1.0.0-beta.6/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/) | | Vision Common | NuGet [0.15.1-beta.1](https://www.nuget.org/packages/Azure.AI.Vision.Common/0.15.1-beta.1) | | GitHub [0.15.1-beta.1](https://msasg.visualstudio.com/Skyman/_git/Carbon) | diff --git a/docs/csharp/language-reference/compiler-messages/string-literal.md b/docs/csharp/language-reference/compiler-messages/string-literal.md index 396966581ceb0..23598c3d6c8c7 100644 --- a/docs/csharp/language-reference/compiler-messages/string-literal.md +++ b/docs/csharp/language-reference/compiler-messages/string-literal.md @@ -1,11 +1,12 @@ --- -title: Errors and warnings for string literal declarations -description: This article helps you diagnose and correct compiler errors and warnings when you declare string literals as constants or variables. +title: Resolve errors and warnings for string literal declarations +description: Learn how to diagnose and correct C# compiler errors and warnings when you declare string literals, including basic strings, raw strings, and UTF-8 strings. f1_keywords: - "CS1009" - "CS1011" - "CS1012" - "CS1039" + - "CS8996" - "CS8997" - "CS8998" - "CS8999" @@ -20,6 +21,8 @@ f1_keywords: - "CS9008" - "CS9009" - "CS1010" + - "CS9026" + - "CS9047" - "CS9274" - "CS9315" helpviewer_keywords: @@ -27,6 +30,7 @@ helpviewer_keywords: - "CS1011" - "CS1012" - "CS1039" + - "CS8996" - "CS8997" - "CS8998" - "CS8999" @@ -41,14 +45,16 @@ helpviewer_keywords: - "CS9008" - "CS9009" - "CS1010" + - "CS9026" + - "CS9047" - "CS9274" - "CS9315" -ms.date: 10/09/2025 +ms.date: 12/08/2025 ai-usage: ai-assisted --- -# Errors and warnings for string literal declarations +# Resolve errors and warnings for string literal declarations -There are several errors related to declaring string constants or string literals. +The C# compiler generates errors and warnings when you declare string literals with incorrect syntax or use them in unsupported contexts. These diagnostics help you identify issues with basic string literals, character literals, raw string literals, and UTF-8 string literals.