From a414461570609b59f003d65d96b53f83c68fb3d9 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Wed, 1 Oct 2025 15:37:03 -0400 Subject: [PATCH] .NET: Re-enable ImplicitUsings in samples and clean up NoWarns (#1060) * Re-enable ImplicitUsings in samples and clean up NoWarns * Fix dotnet format * More dotnet format * More dotnet format --------- Co-authored-by: Chris <66376200+crickman@users.noreply.github.com> --- dotnet/.editorconfig | 1 + dotnet/Directory.Build.props | 5 ++--- dotnet/agent-framework-dotnet.slnx | 1 + dotnet/samples/.editorconfig | 16 ++++++++++++---- .../A2AClientServer/A2AClient/A2AClient.csproj | 1 - .../A2AClientServer/A2AServer/A2AServer.csproj | 1 - dotnet/samples/Directory.Build.props | 1 - .../Agent_With_A2A/Agent_With_A2A.csproj | 2 +- .../AgentProviders/Agent_With_A2A/Program.cs | 1 - .../Agent_With_AzureFoundry.csproj | 2 +- .../Agent_With_AzureFoundry/Program.cs | 1 - .../Agent_With_AzureOpenAIChatCompletion.csproj | 2 +- .../Program.cs | 1 - .../Agent_With_AzureOpenAIResponses.csproj | 2 +- .../Agent_With_AzureOpenAIResponses/Program.cs | 3 --- .../Agent_With_CustomImplementation.csproj | 2 +- .../Agent_With_CustomImplementation/Program.cs | 5 ----- .../Agent_With_ONNX/Agent_With_ONNX.csproj | 2 +- .../AgentProviders/Agent_With_ONNX/Program.cs | 1 - .../Agent_With_Ollama/Agent_With_Ollama.csproj | 2 +- .../AgentProviders/Agent_With_Ollama/Program.cs | 1 - .../Agent_With_OpenAIAssistants.csproj | 2 +- .../Agent_With_OpenAIAssistants/Program.cs | 3 --- .../Agent_With_OpenAIChatCompletion.csproj | 2 +- .../Agent_With_OpenAIChatCompletion/Program.cs | 1 - .../Agent_With_OpenAIResponses.csproj | 2 +- .../Agent_With_OpenAIResponses/Program.cs | 3 --- .../Agent_OpenAI_Step01_Running.csproj | 7 +------ .../Agent_OpenAI_Step01_Running/Program.cs | 2 -- .../Agent_OpenAI_Step02_Reasoning.csproj | 7 +++---- .../Agent_OpenAI_Step02_Reasoning/Program.cs | 1 - .../Agent_Step01_Running.csproj | 2 +- .../Agents/Agent_Step01_Running/Program.cs | 1 - .../Agent_Step02_MultiturnConversation.csproj | 2 +- .../Program.cs | 1 - .../Agent_Step03_UsingFunctionTools.csproj | 2 +- .../Agent_Step03_UsingFunctionTools/Program.cs | 1 - ...Step04_UsingFunctionToolsWithApprovals.csproj | 2 +- .../Program.cs | 2 -- .../Agent_Step05_StructuredOutput.csproj | 2 +- .../Agent_Step05_StructuredOutput/Program.cs | 1 - .../Agent_Step06_PersistedConversations.csproj | 2 +- .../Program.cs | 2 -- .../Agent_Step07_3rdPartyThreadStorage.csproj | 2 +- .../Program.cs | 5 ----- .../Agent_Step08_Observability.csproj | 2 +- .../Agents/Agent_Step08_Observability/Program.cs | 1 - .../Agent_Step09_DependencyInjection.csproj | 2 +- .../Agent_Step09_DependencyInjection/Program.cs | 3 --- .../Agent_Step10_AsMcpTool.csproj | 2 +- .../Agents/Agent_Step10_AsMcpTool/Program.cs | 1 - .../Agent_Step11_UsingImages.csproj | 2 +- .../Agents/Agent_Step11_UsingImages/Program.cs | 1 - .../Agent_Step12_AsFunctionTool.csproj | 2 +- .../Agent_Step12_AsFunctionTool/Program.cs | 1 - .../Agent_Step13_Memory.csproj | 2 +- .../Agents/Agent_Step13_Memory/Program.cs | 4 ---- .../Agent_Step14_Middleware.csproj | 3 +-- .../Agents/Agent_Step14_Middleware/Program.cs | 7 ------- .../Agent_Step15_Plugins.csproj | 4 ++-- .../Agents/Agent_Step15_Plugins/Program.cs | 2 -- .../Agent_MCP_Server/Agent_MCP_Server.csproj | 2 +- .../Agent_MCP_Server/Program.cs | 2 -- .../Agent_MCP_Server_Auth.csproj | 2 +- .../Agent_MCP_Server_Auth/Program.cs | 4 ---- .../FoundryAgent_Hosted_MCP.csproj | 2 +- .../FoundryAgent_Hosted_MCP/Program.cs | 1 - .../CustomAgentExecutors.csproj | 2 +- .../Agents/CustomAgentExecutors/Program.cs | 2 -- .../Agents/FoundryAgent/FoundryAgent.csproj | 2 +- .../Workflows/Agents/FoundryAgent/Program.cs | 2 -- .../Agents/WorkflowAsAnAgent/Program.cs | 3 --- .../WorkflowAsAnAgent/WorkflowAsAnAgent.csproj | 2 +- .../Agents/WorkflowAsAnAgent/WorkflowHelper.cs | 3 --- .../CheckpointAndRehydrate.csproj | 2 +- .../Checkpoint/CheckpointAndRehydrate/Program.cs | 3 --- .../CheckpointAndRehydrate/WorkflowHelper.cs | 2 -- .../CheckpointAndResume.csproj | 2 +- .../Checkpoint/CheckpointAndResume/Program.cs | 4 ---- .../CheckpointAndResume/WorkflowHelper.cs | 2 -- .../CheckpointWithHumanInTheLoop.csproj | 2 +- .../CheckpointWithHumanInTheLoop/Program.cs | 4 ---- .../WorkflowHelper.cs | 2 -- .../Concurrent/Concurrent/Concurrent.csproj | 2 +- .../Workflows/Concurrent/Concurrent/Program.cs | 4 ---- .../01_EdgeCondition/01_EdgeCondition.csproj | 2 +- .../ConditionalEdges/01_EdgeCondition/Program.cs | 2 -- .../01_EdgeCondition/Resources.cs | 2 -- .../02_SwitchCase/02_SwitchCase.csproj | 2 +- .../ConditionalEdges/02_SwitchCase/Program.cs | 2 -- .../ConditionalEdges/02_SwitchCase/Resources.cs | 2 -- .../03_MultiSelection/03_MultiSelection.csproj | 2 +- .../03_MultiSelection/Program.cs | 3 --- .../03_MultiSelection/Resources.cs | 2 -- .../Declarative/DeclarativeWorkflow.csproj | 2 +- .../Workflows/Declarative/Program.cs | 5 ----- .../DeclarativeCode/DeclarativeCode.csproj | 2 +- .../Workflows/DeclarativeCode/Generated.cs | 1 - .../Workflows/DeclarativeCode/Program.cs | 5 ----- .../DeclarativeEject/DeclarativeEject.csproj | 2 +- .../Workflows/DeclarativeEject/Program.cs | 3 --- .../HumanInTheLoopBasic.csproj | 2 +- .../HumanInTheLoopBasic/Program.cs | 2 -- .../HumanInTheLoopBasic/WorkflowHelper.cs | 1 - .../GettingStarted/Workflows/Loop/Loop.csproj | 2 +- .../GettingStarted/Workflows/Loop/Program.cs | 2 -- .../AspireDashboard/AspireDashboard.csproj | 2 +- .../Observability/AspireDashboard/Program.cs | 3 --- .../Workflows/SharedStates/Program.cs | 4 ---- .../Workflows/SharedStates/Resources.cs | 2 -- .../Workflows/SharedStates/SharedStates.csproj | 2 +- .../Workflows/Visualization/Program.cs | 1 - .../Workflows/Visualization/Visualization.csproj | 2 +- .../01_ExecutorsAndEdges.csproj | 2 +- .../01_ExecutorsAndEdges/Program.cs | 3 --- .../02_Streaming/02_Streaming.csproj | 2 +- .../_Foundational/02_Streaming/Program.cs | 3 --- .../03_AgentsInWorkflows.csproj | 2 +- .../03_AgentsInWorkflows/Program.cs | 2 -- .../04_AgentWorkflowPatterns.csproj | 2 +- .../04_AgentWorkflowPatterns/Program.cs | 4 ---- .../05_MultiModelService.csproj | 3 +-- .../05_MultiModelService/Program.cs | 1 - .../AzureAIFoundry_Step01_Basics.csproj | 4 ++-- .../AzureAIFoundry/Step01_Basics/Program.cs | 2 -- .../AzureAIFoundry_Step02_ToolCall.csproj | 1 - .../AzureAIFoundry/Step02_ToolCall/Program.cs | 2 -- ...reAIFoundry_Step03_DependencyInjection.csproj | 1 - .../Step03_DependencyInjection/Program.cs | 2 -- .../AzureAIFoundry_Step04_CodeInterpreter.csproj | 1 - .../Step04_CodeInterpreter/Program.cs | 5 ----- .../AzureOpenAI_Step01_Basics.csproj | 1 - .../AzureOpenAI_Step02_ToolCall.csproj | 1 - ...AzureOpenAI_Step03_DependencyInjection.csproj | 1 - .../AzureOpenAIAssistants_Step01_Basics.csproj | 1 - .../Step01_Basics/Program.cs | 2 -- .../AzureOpenAIAssistants_Step02_ToolCall.csproj | 1 - .../Step02_ToolCall/Program.cs | 2 -- ...IAssistants_Step03_DependencyInjection.csproj | 1 - .../Step03_DependencyInjection/Program.cs | 2 -- ...penAIAssistants_Step04_CodeInterpreter.csproj | 1 - .../Step04_CodeInterpreter/Program.cs | 5 ----- .../AzureOpenAIResponses_Step01_Basics.csproj | 1 - .../Step01_Basics/Program.cs | 3 --- ...eOpenAIResponses_Step02_ReasoningModel.csproj | 1 - .../Step02_ReasoningModel/Program.cs | 3 --- .../AzureOpenAIResponses_Step03_ToolCall.csproj | 1 - .../Step03_ToolCall/Program.cs | 2 -- ...AIResponses_Step04_DependencyInjection.csproj | 1 - .../Step04_DependencyInjection/Program.cs | 2 -- .../Step01_Basics/OpenAI_Step01_Basics.csproj | 1 - .../OpenAI_Step02_ToolCall.csproj | 1 - .../OpenAI_Step03_DependencyInjection.csproj | 1 - .../OpenAIAssistants_Step01_Basics.csproj | 1 - .../OpenAIAssistants/Step01_Basics/Program.cs | 2 -- .../OpenAIAssistants_Step02_ToolCall.csproj | 1 - .../OpenAIAssistants/Step02_ToolCall/Program.cs | 2 -- ...IAssistants_Step03_DependencyInjection.csproj | 1 - .../Step03_DependencyInjection/Program.cs | 2 -- ...penAIAssistants_Step04_CodeInterpreter.csproj | 1 - .../Step04_CodeInterpreter/Program.cs | 5 ----- .../OpenAIResponses_Step01_Basics.csproj | 1 - .../OpenAIResponses/Step01_Basics/Program.cs | 3 --- .../OpenAIResponses_Step02_ReasoningModel.csproj | 1 - .../Step02_ReasoningModel/Program.cs | 3 --- .../OpenAIResponses_Step03_ToolCall.csproj | 1 - .../OpenAIResponses/Step03_ToolCall/Program.cs | 2 -- ...AIResponses_Step04_DependencyInjection.csproj | 1 - .../Step04_DependencyInjection/Program.cs | 2 -- .../CompilerFeatureRequiredAttribute.cs | 2 +- .../Microsoft.Agents.AI.Abstractions/AIAgent.cs | 2 +- .../AIAgentMetadata.cs | 2 +- .../AIContextProvider.cs | 4 ++-- .../AgentRunResponse.cs | 3 --- .../AgentRunResponseExtensions.cs | 3 --- .../AgentThreadMetadata.cs | 2 +- .../Microsoft.Agents.AI.Abstractions.csproj | 2 +- .../Microsoft.Agents.AI.AzureAI.csproj | 1 - ...osoft.Agents.AI.Hosting.A2A.AspNetCore.csproj | 1 - .../Microsoft.Agents.AI.Hosting.A2A.csproj | 1 - .../Microsoft.Agents.AI.OpenAI.csproj | 2 +- .../ChatClient/ChatClientAgent.cs | 2 -- dotnet/tests/.editorconfig | 8 +++++++- .../AIAgentTests.cs | 2 -- .../Microsoft.Agents.AI.Hosting.A2A.Tests.csproj | 1 - .../OpenAIAssistantClientExtensionsTests.cs | 2 -- .../OpenAIResponseClientExtensionsTests.cs | 2 -- .../DeclarativeCodeGenTest.cs | 8 ++++---- .../Framework/AgentFactory.cs | 6 ++---- ...Workflows.Declarative.IntegrationTests.csproj | 1 - .../Extensions/ObjectExtensionsTests.cs | 10 +++++----- ...nts.AI.Workflows.Declarative.UnitTests.csproj | 1 - 192 files changed, 100 insertions(+), 345 deletions(-) diff --git a/dotnet/.editorconfig b/dotnet/.editorconfig index 14fe9911a1..c0d0d04fe9 100644 --- a/dotnet/.editorconfig +++ b/dotnet/.editorconfig @@ -198,6 +198,7 @@ dotnet_diagnostic.CA1508.severity = none # Avoid dead conditional code. Too many dotnet_diagnostic.CA1510.severity = none # ArgumentNullException.Throw dotnet_diagnostic.CA1512.severity = none # ArgumentOutOfRangeException.Throw dotnet_diagnostic.CA1515.severity = none # Making public types from exes internal +dotnet_diagnostic.CA1707.severity = none # Identifiers should not contain underscores dotnet_diagnostic.CA1846.severity = none # Prefer 'AsSpan' over 'Substring' dotnet_diagnostic.CA1848.severity = none # For improved performance, use the LoggerMessage delegates dotnet_diagnostic.CA1849.severity = none # Use async equivalent; analyzer is currently noisy diff --git a/dotnet/Directory.Build.props b/dotnet/Directory.Build.props index a1bb7cf599..98d593acaf 100644 --- a/dotnet/Directory.Build.props +++ b/dotnet/Directory.Build.props @@ -8,8 +8,7 @@ true 13 enable - disable - $(NoWarn);IDE0290;IDE0079;NU5128;CS8002 + $(NoWarn);NU5128 true net9.0 net9.0;net8.0;netstandard2.0;net472 @@ -33,7 +32,7 @@ - $(NoWarn);CS8604;CS8602 + $(NoWarn);nullable diff --git a/dotnet/agent-framework-dotnet.slnx b/dotnet/agent-framework-dotnet.slnx index b2817cbf12..e6252a64eb 100644 --- a/dotnet/agent-framework-dotnet.slnx +++ b/dotnet/agent-framework-dotnet.slnx @@ -55,6 +55,7 @@ + diff --git a/dotnet/samples/.editorconfig b/dotnet/samples/.editorconfig index 0e87de9ec1..d260a0e568 100644 --- a/dotnet/samples/.editorconfig +++ b/dotnet/samples/.editorconfig @@ -1,8 +1,16 @@ # Suppressing errors for Sample projects under dotnet/samples folder [*.cs] -dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task -dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member -dotnet_diagnostic.IDE1006.severity = warning # Naming rule violations -dotnet_diagnostic.VSTHRD111.severity = none # Use .ConfigureAwait(bool) is hidden by default, set to none to prevent IDE from changing on autosave dotnet_diagnostic.CA1716.severity = none # Add summary to documentation comment. dotnet_diagnostic.CA2000.severity = none # Call System.IDisposable.Dispose on object before all references to it are out of scope +dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task + +dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member + +dotnet_diagnostic.IDE1006.severity = warning # Naming rule violations + +dotnet_diagnostic.VSTHRD111.severity = none # Use .ConfigureAwait(bool) is hidden by default, set to none to prevent IDE from changing on autosave +dotnet_diagnostic.VSTHRD200.severity = none # Use Async suffix for async methods + +dotnet_diagnostic.MEAI001.severity = none # [Experimental] APIs in Microsoft.Extensions.AI +dotnet_diagnostic.OPENAI001.severity = none # [Experimental] APIs in OpenAI +dotnet_diagnostic.SKEXP0110.severity = none # [Experimental] APIs in Microsoft.SemanticKernel \ No newline at end of file diff --git a/dotnet/samples/A2AClientServer/A2AClient/A2AClient.csproj b/dotnet/samples/A2AClientServer/A2AClient/A2AClient.csproj index ed56db458d..3ba914b69c 100644 --- a/dotnet/samples/A2AClientServer/A2AClient/A2AClient.csproj +++ b/dotnet/samples/A2AClientServer/A2AClient/A2AClient.csproj @@ -6,7 +6,6 @@ enable enable 5ee045b0-aea3-4f08-8d31-32d1a6f8fed0 - $(NoWarn);CS1591;VSTHRD111;CA2007;SKEXP0110 diff --git a/dotnet/samples/A2AClientServer/A2AServer/A2AServer.csproj b/dotnet/samples/A2AClientServer/A2AServer/A2AServer.csproj index 63259ebaa7..06879c9330 100644 --- a/dotnet/samples/A2AClientServer/A2AServer/A2AServer.csproj +++ b/dotnet/samples/A2AClientServer/A2AServer/A2AServer.csproj @@ -6,7 +6,6 @@ enable enable 5ee045b0-aea3-4f08-8d31-32d1a6f8fed0 - $(NoWarn);CS1591;VSTHRD111;CA2007;SKEXP0110 diff --git a/dotnet/samples/Directory.Build.props b/dotnet/samples/Directory.Build.props index 065ab34672..dd86677c3e 100644 --- a/dotnet/samples/Directory.Build.props +++ b/dotnet/samples/Directory.Build.props @@ -7,7 +7,6 @@ false net472;net9.0 5ee045b0-aea3-4f08-8d31-32d1a6f8fed0 - $(NoWarn);CA1707;MEAI001 diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_A2A/Agent_With_A2A.csproj b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_A2A/Agent_With_A2A.csproj index 3e5e68887c..4d78bf70c1 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_A2A/Agent_With_A2A.csproj +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_A2A/Agent_With_A2A.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_A2A/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_A2A/Program.cs index 854a2a7bd2..46ac8a55fa 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_A2A/Program.cs +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_A2A/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use a simple AI agent with an existing A2A agent. -using System; using A2A; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureFoundry/Agent_With_AzureFoundry.csproj b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureFoundry/Agent_With_AzureFoundry.csproj index 5a4979eb5b..b8d701fbcd 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureFoundry/Agent_With_AzureFoundry.csproj +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureFoundry/Agent_With_AzureFoundry.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureFoundry/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureFoundry/Program.cs index f0a6f6c406..31f18ee7ae 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureFoundry/Program.cs +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureFoundry/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use a simple AI agent with Azure Foundry Agents as the backend. -using System; using Azure.AI.Agents.Persistent; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIChatCompletion/Agent_With_AzureOpenAIChatCompletion.csproj b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIChatCompletion/Agent_With_AzureOpenAIChatCompletion.csproj index a7635e0d7d..0eacdab258 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIChatCompletion/Agent_With_AzureOpenAIChatCompletion.csproj +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIChatCompletion/Agent_With_AzureOpenAIChatCompletion.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIChatCompletion/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIChatCompletion/Program.cs index b6b90df7ea..29a8077aeb 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIChatCompletion/Program.cs +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIChatCompletion/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use a simple AI agent with Azure OpenAI Chat Completion as the backend. -using System; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIResponses/Agent_With_AzureOpenAIResponses.csproj b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIResponses/Agent_With_AzureOpenAIResponses.csproj index a7635e0d7d..0eacdab258 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIResponses/Agent_With_AzureOpenAIResponses.csproj +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIResponses/Agent_With_AzureOpenAIResponses.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIResponses/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIResponses/Program.cs index bf69a9a0a1..6b6f7582d5 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIResponses/Program.cs +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIResponses/Program.cs @@ -2,9 +2,6 @@ // This sample shows how to create and use a simple AI agent with Azure OpenAI Responses as the backend. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - -using System; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_CustomImplementation/Agent_With_CustomImplementation.csproj b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_CustomImplementation/Agent_With_CustomImplementation.csproj index 6ff5b419ff..aa1c382aef 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_CustomImplementation/Agent_With_CustomImplementation.csproj +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_CustomImplementation/Agent_With_CustomImplementation.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_CustomImplementation/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_CustomImplementation/Program.cs index 295539d45b..fd00618f5f 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_CustomImplementation/Program.cs +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_CustomImplementation/Program.cs @@ -4,13 +4,8 @@ // In this case the agent doesn't use AI at all, and simply parrots back the user input in upper case. // You can however, build a fully custom agent that uses AI in any way you want. -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.CompilerServices; using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; using Microsoft.Agents.AI; using Microsoft.Extensions.AI; using SampleApp; diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_ONNX/Agent_With_ONNX.csproj b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_ONNX/Agent_With_ONNX.csproj index deb7b1392d..c4a9467179 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_ONNX/Agent_With_ONNX.csproj +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_ONNX/Agent_With_ONNX.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_ONNX/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_ONNX/Program.cs index 085d4906e2..aed123899c 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_ONNX/Program.cs +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_ONNX/Program.cs @@ -3,7 +3,6 @@ // This sample shows how to create and use a simple AI agent with ONNX as the backend. // WARNING: ONNX doesn't support function calling, so any function tools passed to the agent will be ignored. -using System; using Microsoft.Agents.AI; using Microsoft.ML.OnnxRuntimeGenAI; diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_Ollama/Agent_With_Ollama.csproj b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_Ollama/Agent_With_Ollama.csproj index ea61ac98d5..1ad175831b 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_Ollama/Agent_With_Ollama.csproj +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_Ollama/Agent_With_Ollama.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_Ollama/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_Ollama/Program.cs index 28257fbe31..6802a8c590 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_Ollama/Program.cs +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_Ollama/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use a simple AI agent with Ollama as the backend. -using System; using Microsoft.Agents.AI; using OllamaSharp; diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Agent_With_OpenAIAssistants.csproj b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Agent_With_OpenAIAssistants.csproj index 3197b165ca..0629a84bd0 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Agent_With_OpenAIAssistants.csproj +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Agent_With_OpenAIAssistants.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Program.cs index ce490b9892..9a91e43d37 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Program.cs +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Program.cs @@ -5,9 +5,6 @@ // WARNING: The Assistants API is deprecated and will be shut down. // For more information see the OpenAI documentation: https://platform.openai.com/docs/assistants/migration -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - -using System; using Microsoft.Agents.AI; using OpenAI; diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIChatCompletion/Agent_With_OpenAIChatCompletion.csproj b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIChatCompletion/Agent_With_OpenAIChatCompletion.csproj index 3197b165ca..0629a84bd0 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIChatCompletion/Agent_With_OpenAIChatCompletion.csproj +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIChatCompletion/Agent_With_OpenAIChatCompletion.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIChatCompletion/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIChatCompletion/Program.cs index 9b296859bb..631a7f29ae 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIChatCompletion/Program.cs +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIChatCompletion/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use a simple AI agent with OpenAI Chat Completion as the backend. -using System; using Microsoft.Agents.AI; using OpenAI; diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIResponses/Agent_With_OpenAIResponses.csproj b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIResponses/Agent_With_OpenAIResponses.csproj index 3197b165ca..0629a84bd0 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIResponses/Agent_With_OpenAIResponses.csproj +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIResponses/Agent_With_OpenAIResponses.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIResponses/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIResponses/Program.cs index 8da7c29645..bd1cab2b6f 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIResponses/Program.cs +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIResponses/Program.cs @@ -2,9 +2,6 @@ // This sample shows how to create and use a simple AI agent with OpenAI Responses as the backend. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - -using System; using Microsoft.Agents.AI; using OpenAI; diff --git a/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Agent_OpenAI_Step01_Running.csproj b/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Agent_OpenAI_Step01_Running.csproj index 9118c73a49..0629a84bd0 100644 --- a/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Agent_OpenAI_Step01_Running.csproj +++ b/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Agent_OpenAI_Step01_Running.csproj @@ -5,14 +5,9 @@ net9.0 enable - disable + enable - - - - - diff --git a/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Program.cs b/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Program.cs index c3c10dc6f5..faa32d80a0 100644 --- a/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Program.cs +++ b/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Program.cs @@ -2,9 +2,7 @@ // This sample shows how to create and use a simple AI agent with OpenAI as the backend. -using System; using System.ClientModel; -using System.Linq; using Microsoft.Agents.AI; using OpenAI; using OpenAI.Chat; diff --git a/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Agent_OpenAI_Step02_Reasoning.csproj b/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Agent_OpenAI_Step02_Reasoning.csproj index 2115ea3d62..4253d9cf9e 100644 --- a/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Agent_OpenAI_Step02_Reasoning.csproj +++ b/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Agent_OpenAI_Step02_Reasoning.csproj @@ -3,14 +3,13 @@ Exe net9.0 + enable - disable - $(NoWarn);OPENAI001 + enable - + \ No newline at end of file diff --git a/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Program.cs b/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Program.cs index 8cd16ba00a..01f8d46ee1 100644 --- a/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Program.cs +++ b/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use an AI agent with reasoning capabilities. -using System; using Microsoft.Agents.AI; using Microsoft.Extensions.AI; using OpenAI; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step01_Running/Agent_Step01_Running.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step01_Running/Agent_Step01_Running.csproj index 464e39231f..8298cfe6e8 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step01_Running/Agent_Step01_Running.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step01_Running/Agent_Step01_Running.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step01_Running/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step01_Running/Program.cs index c27ba0b0cb..d5142381c9 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step01_Running/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step01_Running/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use a simple AI agent with Azure OpenAI as the backend. -using System; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step02_MultiturnConversation/Agent_Step02_MultiturnConversation.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step02_MultiturnConversation/Agent_Step02_MultiturnConversation.csproj index 464e39231f..8298cfe6e8 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step02_MultiturnConversation/Agent_Step02_MultiturnConversation.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step02_MultiturnConversation/Agent_Step02_MultiturnConversation.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step02_MultiturnConversation/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step02_MultiturnConversation/Program.cs index 3a38a38c7b..17cab99bd4 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step02_MultiturnConversation/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step02_MultiturnConversation/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use a simple AI agent with a multi-turn conversation. -using System; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step03_UsingFunctionTools/Agent_Step03_UsingFunctionTools.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step03_UsingFunctionTools/Agent_Step03_UsingFunctionTools.csproj index 464e39231f..8298cfe6e8 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step03_UsingFunctionTools/Agent_Step03_UsingFunctionTools.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step03_UsingFunctionTools/Agent_Step03_UsingFunctionTools.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step03_UsingFunctionTools/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step03_UsingFunctionTools/Program.cs index fb7eec50f1..b2287fda4b 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step03_UsingFunctionTools/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step03_UsingFunctionTools/Program.cs @@ -3,7 +3,6 @@ // This sample demonstrates how to use a ChatClientAgent with function tools. // It shows both non-streaming and streaming agent interactions using menu-related tools. -using System; using System.ComponentModel; using Azure.AI.OpenAI; using Azure.Identity; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step04_UsingFunctionToolsWithApprovals/Agent_Step04_UsingFunctionToolsWithApprovals.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step04_UsingFunctionToolsWithApprovals/Agent_Step04_UsingFunctionToolsWithApprovals.csproj index 464e39231f..8298cfe6e8 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step04_UsingFunctionToolsWithApprovals/Agent_Step04_UsingFunctionToolsWithApprovals.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step04_UsingFunctionToolsWithApprovals/Agent_Step04_UsingFunctionToolsWithApprovals.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step04_UsingFunctionToolsWithApprovals/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step04_UsingFunctionToolsWithApprovals/Program.cs index f7944f5cff..31a545dbd6 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step04_UsingFunctionToolsWithApprovals/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step04_UsingFunctionToolsWithApprovals/Program.cs @@ -5,9 +5,7 @@ // If the agent is hosted in a service, with a remote user, combine this sample with the Persisted Conversations sample to persist the chat history // while the agent is waiting for user input. -using System; using System.ComponentModel; -using System.Linq; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step05_StructuredOutput/Agent_Step05_StructuredOutput.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step05_StructuredOutput/Agent_Step05_StructuredOutput.csproj index 464e39231f..8298cfe6e8 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step05_StructuredOutput/Agent_Step05_StructuredOutput.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step05_StructuredOutput/Agent_Step05_StructuredOutput.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step05_StructuredOutput/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step05_StructuredOutput/Program.cs index d08e3e24e6..1d73b9b83a 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step05_StructuredOutput/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step05_StructuredOutput/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use a simple AI agent with Azure OpenAI as the backend, to produce structured output using JSON schema from a class. -using System; using System.ComponentModel; using System.Text.Json; using System.Text.Json.Serialization; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step06_PersistedConversations/Agent_Step06_PersistedConversations.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step06_PersistedConversations/Agent_Step06_PersistedConversations.csproj index 464e39231f..8298cfe6e8 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step06_PersistedConversations/Agent_Step06_PersistedConversations.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step06_PersistedConversations/Agent_Step06_PersistedConversations.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step06_PersistedConversations/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step06_PersistedConversations/Program.cs index ee902f00c3..87093525e7 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step06_PersistedConversations/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step06_PersistedConversations/Program.cs @@ -2,8 +2,6 @@ // This sample shows how to create and use a simple AI agent with a conversation that can be persisted to disk. -using System; -using System.IO; using System.Text.Json; using Azure.AI.OpenAI; using Azure.Identity; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step07_3rdPartyThreadStorage/Agent_Step07_3rdPartyThreadStorage.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step07_3rdPartyThreadStorage/Agent_Step07_3rdPartyThreadStorage.csproj index ac6c3cc673..1caf270c49 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step07_3rdPartyThreadStorage/Agent_Step07_3rdPartyThreadStorage.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step07_3rdPartyThreadStorage/Agent_Step07_3rdPartyThreadStorage.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step07_3rdPartyThreadStorage/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step07_3rdPartyThreadStorage/Program.cs index ecc9f4738d..4daf74f569 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step07_3rdPartyThreadStorage/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step07_3rdPartyThreadStorage/Program.cs @@ -4,12 +4,7 @@ // This sample shows how to create and use a simple AI agent with a conversation that can be persisted to disk. -using System; -using System.Collections.Generic; -using System.Linq; using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Agent_Step08_Observability.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Agent_Step08_Observability.csproj index 3da6b0adac..1f8c39c55f 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Agent_Step08_Observability.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Agent_Step08_Observability.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Program.cs index dea7d03599..2826eb06b0 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use a simple AI agent with Azure OpenAI as the backend that logs telemetry using OpenTelemetry. -using System; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step09_DependencyInjection/Agent_Step09_DependencyInjection.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step09_DependencyInjection/Agent_Step09_DependencyInjection.csproj index 04055b4fb1..b0890e1817 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step09_DependencyInjection/Agent_Step09_DependencyInjection.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step09_DependencyInjection/Agent_Step09_DependencyInjection.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step09_DependencyInjection/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step09_DependencyInjection/Program.cs index 6db03bd5d8..6f83fc26b9 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step09_DependencyInjection/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step09_DependencyInjection/Program.cs @@ -4,9 +4,6 @@ // This sample shows how to use dependency injection to register an AIAgent and use it from a hosted service with a user input chat loop. -using System; -using System.Threading; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step10_AsMcpTool/Agent_Step10_AsMcpTool.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step10_AsMcpTool/Agent_Step10_AsMcpTool.csproj index 166798ac3d..3ff0cf550a 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step10_AsMcpTool/Agent_Step10_AsMcpTool.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step10_AsMcpTool/Agent_Step10_AsMcpTool.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable 3afc9b74-af74-4d8e-ae96-fa1c511d11ac diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step10_AsMcpTool/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step10_AsMcpTool/Program.cs index fe10562ba9..267f10eed3 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step10_AsMcpTool/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step10_AsMcpTool/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to expose an AI agent as an MCP tool. -using System; using Azure.AI.Agents.Persistent; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step11_UsingImages/Agent_Step11_UsingImages.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step11_UsingImages/Agent_Step11_UsingImages.csproj index 42cb643319..7e9e70c763 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step11_UsingImages/Agent_Step11_UsingImages.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step11_UsingImages/Agent_Step11_UsingImages.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step11_UsingImages/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step11_UsingImages/Program.cs index 318788f352..8e8c5701ad 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step11_UsingImages/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step11_UsingImages/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to use Image Multi-Modality with an AI agent. -using System; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Extensions.AI; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step12_AsFunctionTool/Agent_Step12_AsFunctionTool.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step12_AsFunctionTool/Agent_Step12_AsFunctionTool.csproj index 6f629cb3e1..21c8d9e49e 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step12_AsFunctionTool/Agent_Step12_AsFunctionTool.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step12_AsFunctionTool/Agent_Step12_AsFunctionTool.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable 3afc9b74-af74-4d8e-ae96-fa1c511d11ac diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step12_AsFunctionTool/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step12_AsFunctionTool/Program.cs index e5a6c9f45c..e26848f06a 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step12_AsFunctionTool/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step12_AsFunctionTool/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use a Azure OpenAI AI agent as a function tool. -using System; using System.ComponentModel; using Azure.AI.OpenAI; using Azure.Identity; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step13_Memory/Agent_Step13_Memory.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step13_Memory/Agent_Step13_Memory.csproj index 464e39231f..8298cfe6e8 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step13_Memory/Agent_Step13_Memory.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step13_Memory/Agent_Step13_Memory.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step13_Memory/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step13_Memory/Program.cs index 6eedd2ba91..ad59deb97f 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step13_Memory/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step13_Memory/Program.cs @@ -6,12 +6,8 @@ // The component adds a prompt to ask for this information if it is not already known // and provides it to the model before each invocation if known. -using System; -using System.Linq; using System.Text; using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step14_Middleware/Agent_Step14_Middleware.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step14_Middleware/Agent_Step14_Middleware.csproj index 266e373153..09beb78195 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step14_Middleware/Agent_Step14_Middleware.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step14_Middleware/Agent_Step14_Middleware.csproj @@ -5,8 +5,7 @@ net9.0 enable - disable - VSTHRD200;CA1707 + enable diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step14_Middleware/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step14_Middleware/Program.cs index daf2f071cf..096553bf91 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step14_Middleware/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step14_Middleware/Program.cs @@ -5,20 +5,13 @@ // function invocation (logging and result overrides), and human-in-the-loop // approval workflows for sensitive function calls. -using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; using Microsoft.Extensions.AI; -#pragma warning disable MEAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - // Get Azure AI Foundry configuration from environment variables var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); var deploymentName = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o"; diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step15_Plugins/Agent_Step15_Plugins.csproj b/dotnet/samples/GettingStarted/Agents/Agent_Step15_Plugins/Agent_Step15_Plugins.csproj index 82e92ba913..c1cf0bf930 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step15_Plugins/Agent_Step15_Plugins.csproj +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step15_Plugins/Agent_Step15_Plugins.csproj @@ -5,8 +5,8 @@ net9.0 enable - disable - VSTHRD200;CA1707;CA1812 + enable + $(NoWarn);CA1812 Agent_Step15_Plugins diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step15_Plugins/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step15_Plugins/Program.cs index af28433fca..a9f21339f6 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step15_Plugins/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step15_Plugins/Program.cs @@ -9,8 +9,6 @@ // as AI functions. The AsAITools method of the plugin class shows how to specify // which methods should be exposed to the AI agent. -using System; -using System.Collections.Generic; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/Agent_MCP_Server.csproj b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/Agent_MCP_Server.csproj index f94122f1cb..ececa3ea5a 100644 --- a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/Agent_MCP_Server.csproj +++ b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/Agent_MCP_Server.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/Program.cs b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/Program.cs index fc3ebd0436..1a0d236961 100644 --- a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/Program.cs +++ b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/Program.cs @@ -2,8 +2,6 @@ // This sample shows how to create and use a simple AI agent with tools from an MCP Server. -using System; -using System.Linq; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Agent_MCP_Server_Auth.csproj b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Agent_MCP_Server_Auth.csproj index dae2b7cf9d..e068b6745a 100644 --- a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Agent_MCP_Server_Auth.csproj +++ b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Agent_MCP_Server_Auth.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Program.cs b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Program.cs index 59691f6c2f..aae520eec9 100644 --- a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Program.cs +++ b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Program.cs @@ -2,13 +2,9 @@ // This sample shows how to create and use a simple AI agent with tools from an MCP Server that requires authentication. -using System; using System.Diagnostics; using System.Net; -using System.Net.Http; using System.Text; -using System.Threading; -using System.Threading.Tasks; using System.Web; using Azure.AI.OpenAI; using Azure.Identity; diff --git a/dotnet/samples/GettingStarted/ModelContextProtocol/FoundryAgent_Hosted_MCP/FoundryAgent_Hosted_MCP.csproj b/dotnet/samples/GettingStarted/ModelContextProtocol/FoundryAgent_Hosted_MCP/FoundryAgent_Hosted_MCP.csproj index 5a4979eb5b..b8d701fbcd 100644 --- a/dotnet/samples/GettingStarted/ModelContextProtocol/FoundryAgent_Hosted_MCP/FoundryAgent_Hosted_MCP.csproj +++ b/dotnet/samples/GettingStarted/ModelContextProtocol/FoundryAgent_Hosted_MCP/FoundryAgent_Hosted_MCP.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/ModelContextProtocol/FoundryAgent_Hosted_MCP/Program.cs b/dotnet/samples/GettingStarted/ModelContextProtocol/FoundryAgent_Hosted_MCP/Program.cs index 0e44f07b52..eb1741a763 100644 --- a/dotnet/samples/GettingStarted/ModelContextProtocol/FoundryAgent_Hosted_MCP/Program.cs +++ b/dotnet/samples/GettingStarted/ModelContextProtocol/FoundryAgent_Hosted_MCP/Program.cs @@ -2,7 +2,6 @@ // This sample shows how to create and use a simple AI agent with Azure Foundry Agents as the backend. -using System; using Azure.AI.Agents.Persistent; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Workflows/Agents/CustomAgentExecutors/CustomAgentExecutors.csproj b/dotnet/samples/GettingStarted/Workflows/Agents/CustomAgentExecutors/CustomAgentExecutors.csproj index 4d651df293..354163794e 100644 --- a/dotnet/samples/GettingStarted/Workflows/Agents/CustomAgentExecutors/CustomAgentExecutors.csproj +++ b/dotnet/samples/GettingStarted/Workflows/Agents/CustomAgentExecutors/CustomAgentExecutors.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/Agents/CustomAgentExecutors/Program.cs b/dotnet/samples/GettingStarted/Workflows/Agents/CustomAgentExecutors/Program.cs index 3f91950175..17ba3602f8 100644 --- a/dotnet/samples/GettingStarted/Workflows/Agents/CustomAgentExecutors/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Agents/CustomAgentExecutors/Program.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. -using System; using System.Text.Json; using System.Text.Json.Serialization; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Workflows/Agents/FoundryAgent/FoundryAgent.csproj b/dotnet/samples/GettingStarted/Workflows/Agents/FoundryAgent/FoundryAgent.csproj index 0b4e23b0d8..1d24b7253b 100644 --- a/dotnet/samples/GettingStarted/Workflows/Agents/FoundryAgent/FoundryAgent.csproj +++ b/dotnet/samples/GettingStarted/Workflows/Agents/FoundryAgent/FoundryAgent.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/Agents/FoundryAgent/Program.cs b/dotnet/samples/GettingStarted/Workflows/Agents/FoundryAgent/Program.cs index 3c17be892c..3eadeea732 100644 --- a/dotnet/samples/GettingStarted/Workflows/Agents/FoundryAgent/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Agents/FoundryAgent/Program.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Threading.Tasks; using Azure.AI.Agents.Persistent; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/Program.cs b/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/Program.cs index bf758e5c29..49305d9908 100644 --- a/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/Program.cs @@ -1,8 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowAsAnAgent.csproj b/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowAsAnAgent.csproj index 4d651df293..354163794e 100644 --- a/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowAsAnAgent.csproj +++ b/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowAsAnAgent.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowHelper.cs b/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowHelper.cs index b9aeb72e17..1da5e6932e 100644 --- a/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowHelper.cs +++ b/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowHelper.cs @@ -1,8 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.Agents.AI; using Microsoft.Agents.AI.Workflows; using Microsoft.Agents.AI.Workflows.Reflection; diff --git a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/CheckpointAndRehydrate.csproj b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/CheckpointAndRehydrate.csproj index 967cee1d81..0a0945caff 100644 --- a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/CheckpointAndRehydrate.csproj +++ b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/CheckpointAndRehydrate.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/Program.cs b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/Program.cs index 98ac755116..98bf11f172 100644 --- a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/Program.cs @@ -1,8 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; namespace WorkflowCheckpointAndRehydrateSample; diff --git a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/WorkflowHelper.cs b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/WorkflowHelper.cs index 3957ab97e5..f911fa8a05 100644 --- a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/WorkflowHelper.cs +++ b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndRehydrate/WorkflowHelper.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.Threading; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; using Microsoft.Agents.AI.Workflows.Reflection; diff --git a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/CheckpointAndResume.csproj b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/CheckpointAndResume.csproj index 967cee1d81..0a0945caff 100644 --- a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/CheckpointAndResume.csproj +++ b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/CheckpointAndResume.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/Program.cs b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/Program.cs index 7828a0ece8..376d669671 100644 --- a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/Program.cs @@ -1,9 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; namespace WorkflowCheckpointAndResumeSample; diff --git a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/WorkflowHelper.cs b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/WorkflowHelper.cs index f5a22a89e3..8bfabfbf4d 100644 --- a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/WorkflowHelper.cs +++ b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointAndResume/WorkflowHelper.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.Threading; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; using Microsoft.Agents.AI.Workflows.Reflection; diff --git a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/CheckpointWithHumanInTheLoop.csproj b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/CheckpointWithHumanInTheLoop.csproj index 967cee1d81..0a0945caff 100644 --- a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/CheckpointWithHumanInTheLoop.csproj +++ b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/CheckpointWithHumanInTheLoop.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/Program.cs b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/Program.cs index cb16f07f5a..9e96bc3ea3 100644 --- a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/Program.cs @@ -1,9 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; namespace WorkflowCheckpointWithHumanInTheLoopSample; diff --git a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/WorkflowHelper.cs b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/WorkflowHelper.cs index b529d213ae..1a7f51d33c 100644 --- a/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/WorkflowHelper.cs +++ b/dotnet/samples/GettingStarted/Workflows/Checkpoint/CheckpointWithHumanInTheLoop/WorkflowHelper.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.Threading; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; using Microsoft.Agents.AI.Workflows.Reflection; diff --git a/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Concurrent.csproj b/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Concurrent.csproj index 8b5969cb9a..e11fd9fa9a 100644 --- a/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Concurrent.csproj +++ b/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Concurrent.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Program.cs b/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Program.cs index bb6aa6410c..d332e4e5cc 100644 --- a/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Program.cs @@ -1,9 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/01_EdgeCondition.csproj b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/01_EdgeCondition.csproj index c13372f0b9..76f9509ee1 100644 --- a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/01_EdgeCondition.csproj +++ b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/01_EdgeCondition.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/Program.cs b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/Program.cs index 0363325545..bb76360983 100644 --- a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/Program.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. -using System; using System.Text.Json; using System.Text.Json.Serialization; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/Resources.cs b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/Resources.cs index 3d54953adc..7a0d0ea2bd 100644 --- a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/Resources.cs +++ b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/01_EdgeCondition/Resources.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.IO; - namespace WorkflowEdgeConditionSample; /// diff --git a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/02_SwitchCase.csproj b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/02_SwitchCase.csproj index c13372f0b9..76f9509ee1 100644 --- a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/02_SwitchCase.csproj +++ b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/02_SwitchCase.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/Program.cs b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/Program.cs index 13c9cef7f1..216088b74f 100644 --- a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/Program.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. -using System; using System.Text.Json; using System.Text.Json.Serialization; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/Resources.cs b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/Resources.cs index c709bc2156..415a3820a1 100644 --- a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/Resources.cs +++ b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/02_SwitchCase/Resources.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.IO; - namespace WorkflowSwitchCaseSample; /// diff --git a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/03_MultiSelection.csproj b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/03_MultiSelection.csproj index c13372f0b9..76f9509ee1 100644 --- a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/03_MultiSelection.csproj +++ b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/03_MultiSelection.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Program.cs b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Program.cs index 8030e0d715..a87962a32d 100644 --- a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Program.cs @@ -1,10 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Resources.cs b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Resources.cs index e965afd01d..d04a7c8a5f 100644 --- a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Resources.cs +++ b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Resources.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.IO; - namespace WorkflowMultiSelectionSample; /// diff --git a/dotnet/samples/GettingStarted/Workflows/Declarative/DeclarativeWorkflow.csproj b/dotnet/samples/GettingStarted/Workflows/Declarative/DeclarativeWorkflow.csproj index 37ba5f0f5b..70c048f255 100644 --- a/dotnet/samples/GettingStarted/Workflows/Declarative/DeclarativeWorkflow.csproj +++ b/dotnet/samples/GettingStarted/Workflows/Declarative/DeclarativeWorkflow.csproj @@ -6,7 +6,7 @@ net9.0 $(ProjectsDebugTargetFrameworks) enable - disable + enable $(NoWarn);CA1812 diff --git a/dotnet/samples/GettingStarted/Workflows/Declarative/Program.cs b/dotnet/samples/GettingStarted/Workflows/Declarative/Program.cs index 132ea9a5cb..eb9266a1ba 100644 --- a/dotnet/samples/GettingStarted/Workflows/Declarative/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Declarative/Program.cs @@ -1,12 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.IO; -using System.Linq; using System.Reflection; -using System.Threading.Tasks; using Azure.AI.Agents.Persistent; using Azure.Identity; using Microsoft.Agents.AI.Workflows; diff --git a/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/DeclarativeCode.csproj b/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/DeclarativeCode.csproj index c8321d553d..91bb0f69d1 100644 --- a/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/DeclarativeCode.csproj +++ b/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/DeclarativeCode.csproj @@ -6,7 +6,7 @@ net9.0 $(ProjectsDebugTargetFrameworks) enable - disable + enable 5ee045b0-aea3-4f08-8d31-32d1a6f8fed0 $(NoWarn);CA1812 diff --git a/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/Generated.cs b/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/Generated.cs index b16f3dc2f2..e067140912 100644 --- a/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/Generated.cs +++ b/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/Generated.cs @@ -5,7 +5,6 @@ // ------------------------------------------------------------------------------ #nullable enable -#pragma warning disable IDE0005 // Extra using directive is ok. using System; using System.Collections; diff --git a/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/Program.cs b/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/Program.cs index c91ec3702d..f2bea10bd8 100644 --- a/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/DeclarativeCode/Program.cs @@ -1,12 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.IO; -using System.Linq; using System.Reflection; -using System.Threading.Tasks; using Azure.AI.Agents.Persistent; using Azure.Identity; using Microsoft.Agents.AI.Workflows; diff --git a/dotnet/samples/GettingStarted/Workflows/DeclarativeEject/DeclarativeEject.csproj b/dotnet/samples/GettingStarted/Workflows/DeclarativeEject/DeclarativeEject.csproj index c8321d553d..91bb0f69d1 100644 --- a/dotnet/samples/GettingStarted/Workflows/DeclarativeEject/DeclarativeEject.csproj +++ b/dotnet/samples/GettingStarted/Workflows/DeclarativeEject/DeclarativeEject.csproj @@ -6,7 +6,7 @@ net9.0 $(ProjectsDebugTargetFrameworks) enable - disable + enable 5ee045b0-aea3-4f08-8d31-32d1a6f8fed0 $(NoWarn);CA1812 diff --git a/dotnet/samples/GettingStarted/Workflows/DeclarativeEject/Program.cs b/dotnet/samples/GettingStarted/Workflows/DeclarativeEject/Program.cs index fd8eb86cd8..0eeec60b17 100644 --- a/dotnet/samples/GettingStarted/Workflows/DeclarativeEject/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/DeclarativeEject/Program.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. -using System; using System.Diagnostics; -using System.IO; -using System.Linq; using Microsoft.Agents.AI.Workflows.Declarative; namespace Demo.DeclarativeEject; diff --git a/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/HumanInTheLoopBasic.csproj b/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/HumanInTheLoopBasic.csproj index 967cee1d81..0a0945caff 100644 --- a/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/HumanInTheLoopBasic.csproj +++ b/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/HumanInTheLoopBasic.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/Program.cs b/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/Program.cs index 9e250664c7..14ad717049 100644 --- a/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/Program.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; namespace WorkflowHumanInTheLoopBasicSample; diff --git a/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/WorkflowHelper.cs b/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/WorkflowHelper.cs index ae811354f2..79e547693c 100644 --- a/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/WorkflowHelper.cs +++ b/dotnet/samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/WorkflowHelper.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; using Microsoft.Agents.AI.Workflows.Reflection; diff --git a/dotnet/samples/GettingStarted/Workflows/Loop/Loop.csproj b/dotnet/samples/GettingStarted/Workflows/Loop/Loop.csproj index 01d4ee78b0..fcc2aaf5c8 100644 --- a/dotnet/samples/GettingStarted/Workflows/Loop/Loop.csproj +++ b/dotnet/samples/GettingStarted/Workflows/Loop/Loop.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/Loop/Program.cs b/dotnet/samples/GettingStarted/Workflows/Loop/Program.cs index a24222ef47..69d66cc8e6 100644 --- a/dotnet/samples/GettingStarted/Workflows/Loop/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Loop/Program.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; using Microsoft.Agents.AI.Workflows.Reflection; diff --git a/dotnet/samples/GettingStarted/Workflows/Observability/AspireDashboard/AspireDashboard.csproj b/dotnet/samples/GettingStarted/Workflows/Observability/AspireDashboard/AspireDashboard.csproj index 807bc89323..db5479dd0f 100644 --- a/dotnet/samples/GettingStarted/Workflows/Observability/AspireDashboard/AspireDashboard.csproj +++ b/dotnet/samples/GettingStarted/Workflows/Observability/AspireDashboard/AspireDashboard.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/Observability/AspireDashboard/Program.cs b/dotnet/samples/GettingStarted/Workflows/Observability/AspireDashboard/Program.cs index 18d6259cc9..f091e46683 100644 --- a/dotnet/samples/GettingStarted/Workflows/Observability/AspireDashboard/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Observability/AspireDashboard/Program.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. -using System; using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; using Microsoft.Agents.AI.Workflows.Reflection; using OpenTelemetry; diff --git a/dotnet/samples/GettingStarted/Workflows/SharedStates/Program.cs b/dotnet/samples/GettingStarted/Workflows/SharedStates/Program.cs index 511d73bc44..0516513690 100644 --- a/dotnet/samples/GettingStarted/Workflows/SharedStates/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/SharedStates/Program.cs @@ -1,9 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; using Microsoft.Agents.AI.Workflows.Reflection; diff --git a/dotnet/samples/GettingStarted/Workflows/SharedStates/Resources.cs b/dotnet/samples/GettingStarted/Workflows/SharedStates/Resources.cs index 245deb6410..a831387050 100644 --- a/dotnet/samples/GettingStarted/Workflows/SharedStates/Resources.cs +++ b/dotnet/samples/GettingStarted/Workflows/SharedStates/Resources.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.IO; - namespace WorkflowSharedStatesSample; /// diff --git a/dotnet/samples/GettingStarted/Workflows/SharedStates/SharedStates.csproj b/dotnet/samples/GettingStarted/Workflows/SharedStates/SharedStates.csproj index 22b9447cac..2af5bbc1d7 100644 --- a/dotnet/samples/GettingStarted/Workflows/SharedStates/SharedStates.csproj +++ b/dotnet/samples/GettingStarted/Workflows/SharedStates/SharedStates.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/Visualization/Program.cs b/dotnet/samples/GettingStarted/Workflows/Visualization/Program.cs index 8a01356bb9..5e567e7953 100644 --- a/dotnet/samples/GettingStarted/Workflows/Visualization/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Visualization/Program.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; using Microsoft.Agents.AI.Workflows; namespace WorkflowVisualizationSample; diff --git a/dotnet/samples/GettingStarted/Workflows/Visualization/Visualization.csproj b/dotnet/samples/GettingStarted/Workflows/Visualization/Visualization.csproj index 79f5876e0a..c9b83f7c38 100644 --- a/dotnet/samples/GettingStarted/Workflows/Visualization/Visualization.csproj +++ b/dotnet/samples/GettingStarted/Workflows/Visualization/Visualization.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/_Foundational/01_ExecutorsAndEdges/01_ExecutorsAndEdges.csproj b/dotnet/samples/GettingStarted/Workflows/_Foundational/01_ExecutorsAndEdges/01_ExecutorsAndEdges.csproj index 967cee1d81..0a0945caff 100644 --- a/dotnet/samples/GettingStarted/Workflows/_Foundational/01_ExecutorsAndEdges/01_ExecutorsAndEdges.csproj +++ b/dotnet/samples/GettingStarted/Workflows/_Foundational/01_ExecutorsAndEdges/01_ExecutorsAndEdges.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/_Foundational/01_ExecutorsAndEdges/Program.cs b/dotnet/samples/GettingStarted/Workflows/_Foundational/01_ExecutorsAndEdges/Program.cs index 8ee82c4ca8..b64e1bad6b 100644 --- a/dotnet/samples/GettingStarted/Workflows/_Foundational/01_ExecutorsAndEdges/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/_Foundational/01_ExecutorsAndEdges/Program.cs @@ -1,8 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Linq; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; using Microsoft.Agents.AI.Workflows.Reflection; diff --git a/dotnet/samples/GettingStarted/Workflows/_Foundational/02_Streaming/02_Streaming.csproj b/dotnet/samples/GettingStarted/Workflows/_Foundational/02_Streaming/02_Streaming.csproj index 967cee1d81..0a0945caff 100644 --- a/dotnet/samples/GettingStarted/Workflows/_Foundational/02_Streaming/02_Streaming.csproj +++ b/dotnet/samples/GettingStarted/Workflows/_Foundational/02_Streaming/02_Streaming.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/_Foundational/02_Streaming/Program.cs b/dotnet/samples/GettingStarted/Workflows/_Foundational/02_Streaming/Program.cs index 6ea170a7c5..4544ac4212 100644 --- a/dotnet/samples/GettingStarted/Workflows/_Foundational/02_Streaming/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/_Foundational/02_Streaming/Program.cs @@ -1,8 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Linq; -using System.Threading.Tasks; using Microsoft.Agents.AI.Workflows; using Microsoft.Agents.AI.Workflows.Reflection; diff --git a/dotnet/samples/GettingStarted/Workflows/_Foundational/03_AgentsInWorkflows/03_AgentsInWorkflows.csproj b/dotnet/samples/GettingStarted/Workflows/_Foundational/03_AgentsInWorkflows/03_AgentsInWorkflows.csproj index 4d651df293..354163794e 100644 --- a/dotnet/samples/GettingStarted/Workflows/_Foundational/03_AgentsInWorkflows/03_AgentsInWorkflows.csproj +++ b/dotnet/samples/GettingStarted/Workflows/_Foundational/03_AgentsInWorkflows/03_AgentsInWorkflows.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/_Foundational/03_AgentsInWorkflows/Program.cs b/dotnet/samples/GettingStarted/Workflows/_Foundational/03_AgentsInWorkflows/Program.cs index 890b4c6d20..2a3058c611 100644 --- a/dotnet/samples/GettingStarted/Workflows/_Foundational/03_AgentsInWorkflows/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/_Foundational/03_AgentsInWorkflows/Program.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Workflows/_Foundational/04_AgentWorkflowPatterns/04_AgentWorkflowPatterns.csproj b/dotnet/samples/GettingStarted/Workflows/_Foundational/04_AgentWorkflowPatterns/04_AgentWorkflowPatterns.csproj index 4d651df293..354163794e 100644 --- a/dotnet/samples/GettingStarted/Workflows/_Foundational/04_AgentWorkflowPatterns/04_AgentWorkflowPatterns.csproj +++ b/dotnet/samples/GettingStarted/Workflows/_Foundational/04_AgentWorkflowPatterns/04_AgentWorkflowPatterns.csproj @@ -5,7 +5,7 @@ net9.0 enable - disable + enable diff --git a/dotnet/samples/GettingStarted/Workflows/_Foundational/04_AgentWorkflowPatterns/Program.cs b/dotnet/samples/GettingStarted/Workflows/_Foundational/04_AgentWorkflowPatterns/Program.cs index ff789a689e..70a0ddc8a0 100644 --- a/dotnet/samples/GettingStarted/Workflows/_Foundational/04_AgentWorkflowPatterns/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/_Foundational/04_AgentWorkflowPatterns/Program.cs @@ -1,10 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. -using System; -using System.Collections.Generic; -using System.Linq; using System.Text.Json; -using System.Threading.Tasks; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/GettingStarted/Workflows/_Foundational/05_MultiModelService/05_MultiModelService.csproj b/dotnet/samples/GettingStarted/Workflows/_Foundational/05_MultiModelService/05_MultiModelService.csproj index 674bcb15a0..1af928d9b8 100644 --- a/dotnet/samples/GettingStarted/Workflows/_Foundational/05_MultiModelService/05_MultiModelService.csproj +++ b/dotnet/samples/GettingStarted/Workflows/_Foundational/05_MultiModelService/05_MultiModelService.csproj @@ -5,8 +5,7 @@ net9.0 enable - disable - $(NoWarn);OPENAI001 + enable diff --git a/dotnet/samples/GettingStarted/Workflows/_Foundational/05_MultiModelService/Program.cs b/dotnet/samples/GettingStarted/Workflows/_Foundational/05_MultiModelService/Program.cs index 04a7da3c90..caa78430c1 100644 --- a/dotnet/samples/GettingStarted/Workflows/_Foundational/05_MultiModelService/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/_Foundational/05_MultiModelService/Program.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System; using Amazon.BedrockRuntime; using Microsoft.Agents.AI; using Microsoft.Agents.AI.Workflows; diff --git a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step01_Basics/AzureAIFoundry_Step01_Basics.csproj b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step01_Basics/AzureAIFoundry_Step01_Basics.csproj index 94bca0b896..a0295bca1d 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step01_Basics/AzureAIFoundry_Step01_Basics.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step01_Basics/AzureAIFoundry_Step01_Basics.csproj @@ -1,11 +1,11 @@ - + Exe net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 + $(NoWarn);CA1812;RCS1102 true diff --git a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step01_Basics/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step01_Basics/Program.cs index 62e7134f59..cc2769be3d 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step01_Basics/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step01_Basics/Program.cs @@ -6,8 +6,6 @@ using Microsoft.Agents.AI; using Microsoft.SemanticKernel; using Microsoft.SemanticKernel.Agents.AzureAI; -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - var azureEndpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); var deploymentName = System.Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o"; var userInput = "Tell me a joke about a pirate."; diff --git a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step02_ToolCall/AzureAIFoundry_Step02_ToolCall.csproj b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step02_ToolCall/AzureAIFoundry_Step02_ToolCall.csproj index ebae8e9b6a..6c13bf9446 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step02_ToolCall/AzureAIFoundry_Step02_ToolCall.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step02_ToolCall/AzureAIFoundry_Step02_ToolCall.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;CA1050;CA1052 diff --git a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step02_ToolCall/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step02_ToolCall/Program.cs index 4a84915aab..c8a5ba8dab 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step02_ToolCall/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step02_ToolCall/Program.cs @@ -8,8 +8,6 @@ using Microsoft.Extensions.AI; using Microsoft.SemanticKernel; using Microsoft.SemanticKernel.Agents.AzureAI; -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - var azureEndpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); var deploymentName = System.Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o"; var userInput = "What is the weather like in Amsterdam?"; diff --git a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step03_DependencyInjection/AzureAIFoundry_Step03_DependencyInjection.csproj b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step03_DependencyInjection/AzureAIFoundry_Step03_DependencyInjection.csproj index 54b13a7e87..6c13bf9446 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step03_DependencyInjection/AzureAIFoundry_Step03_DependencyInjection.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step03_DependencyInjection/AzureAIFoundry_Step03_DependencyInjection.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs index abddcdd11a..3930603e1f 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs @@ -8,8 +8,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.SemanticKernel; using Microsoft.SemanticKernel.Agents.AzureAI; -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - var azureEndpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); var deploymentName = System.Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o"; var userInput = "Tell me a joke about a pirate."; diff --git a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step04_CodeInterpreter/AzureAIFoundry_Step04_CodeInterpreter.csproj b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step04_CodeInterpreter/AzureAIFoundry_Step04_CodeInterpreter.csproj index 7e93da52d6..e9bdf16aa8 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step04_CodeInterpreter/AzureAIFoundry_Step04_CodeInterpreter.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step04_CodeInterpreter/AzureAIFoundry_Step04_CodeInterpreter.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step04_CodeInterpreter/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step04_CodeInterpreter/Program.cs index 263144eb1e..65665b4b7c 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step04_CodeInterpreter/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureAIFoundry/Step04_CodeInterpreter/Program.cs @@ -9,9 +9,6 @@ using Microsoft.SemanticKernel; using Microsoft.SemanticKernel.Agents; using Microsoft.SemanticKernel.Agents.AzureAI; -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. -#pragma warning disable CS8321 // Local function is declared but never used - var azureEndpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); var deploymentName = System.Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o"; var userInput = "Create a python code file using the code interpreter tool with a code ready to determine the values in the Fibonacci sequence that are less then the value of 101"; @@ -45,7 +42,6 @@ async Task SKAgentAsync() foreach (var item in content.Message.Items) { // Process each item in the message -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. if (item is AnnotationContent annotation) { if (annotation.Kind != AnnotationKind.UrlCitation) @@ -57,7 +53,6 @@ async Task SKAgentAsync() { Console.WriteLine($" [{item.GetType().Name}] File #{fileReference.FileId}"); } -#pragma warning restore SKEXP0110 } } diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step01_Basics/AzureOpenAI_Step01_Basics.csproj b/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step01_Basics/AzureOpenAI_Step01_Basics.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step01_Basics/AzureOpenAI_Step01_Basics.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step01_Basics/AzureOpenAI_Step01_Basics.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step02_ToolCall/AzureOpenAI_Step02_ToolCall.csproj b/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step02_ToolCall/AzureOpenAI_Step02_ToolCall.csproj index f0e4cb609d..9a9c652f30 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step02_ToolCall/AzureOpenAI_Step02_ToolCall.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step02_ToolCall/AzureOpenAI_Step02_ToolCall.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;CA1050;CA1052;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step03_DependencyInjection/AzureOpenAI_Step03_DependencyInjection.csproj b/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step03_DependencyInjection/AzureOpenAI_Step03_DependencyInjection.csproj index 00fc38794f..9a9c652f30 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step03_DependencyInjection/AzureOpenAI_Step03_DependencyInjection.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAI/Step03_DependencyInjection/AzureOpenAI_Step03_DependencyInjection.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step01_Basics/AzureOpenAIAssistants_Step01_Basics.csproj b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step01_Basics/AzureOpenAIAssistants_Step01_Basics.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step01_Basics/AzureOpenAIAssistants_Step01_Basics.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step01_Basics/AzureOpenAIAssistants_Step01_Basics.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step01_Basics/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step01_Basics/Program.cs index 0c0fca9d71..beb7bed1c9 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step01_Basics/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step01_Basics/Program.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step02_ToolCall/AzureOpenAIAssistants_Step02_ToolCall.csproj b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step02_ToolCall/AzureOpenAIAssistants_Step02_ToolCall.csproj index 08ee5fbd36..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step02_ToolCall/AzureOpenAIAssistants_Step02_ToolCall.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step02_ToolCall/AzureOpenAIAssistants_Step02_ToolCall.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;CA1050;CA1052;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step02_ToolCall/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step02_ToolCall/Program.cs index 51a34db5e1..4ec04a276a 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step02_ToolCall/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step02_ToolCall/Program.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - using System.ComponentModel; using Azure.AI.OpenAI; using Azure.Identity; diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step03_DependencyInjection/AzureOpenAIAssistants_Step03_DependencyInjection.csproj b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step03_DependencyInjection/AzureOpenAIAssistants_Step03_DependencyInjection.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step03_DependencyInjection/AzureOpenAIAssistants_Step03_DependencyInjection.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step03_DependencyInjection/AzureOpenAIAssistants_Step03_DependencyInjection.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step03_DependencyInjection/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step03_DependencyInjection/Program.cs index 976f15d776..ad6b00be1c 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step03_DependencyInjection/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step03_DependencyInjection/Program.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step04_CodeInterpreter/AzureOpenAIAssistants_Step04_CodeInterpreter.csproj b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step04_CodeInterpreter/AzureOpenAIAssistants_Step04_CodeInterpreter.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step04_CodeInterpreter/AzureOpenAIAssistants_Step04_CodeInterpreter.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step04_CodeInterpreter/AzureOpenAIAssistants_Step04_CodeInterpreter.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step04_CodeInterpreter/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step04_CodeInterpreter/Program.cs index 805a57e531..5353aaab5f 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step04_CodeInterpreter/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIAssistants/Step04_CodeInterpreter/Program.cs @@ -11,9 +11,6 @@ using Microsoft.SemanticKernel.Agents.OpenAI; using OpenAI; using OpenAI.Assistants; -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. -#pragma warning disable CS8321 // Local function is declared but never used - var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); var deploymentName = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o"; var userInput = "Create a python code file using the code interpreter tool with a code ready to determine the values in the Fibonacci sequence that are less then the value of 101"; @@ -52,7 +49,6 @@ async Task SKAgent() foreach (var item in content.Message.Items) { // Process each item in the message -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. if (item is AnnotationContent annotation) { if (annotation.Kind != AnnotationKind.UrlCitation) @@ -66,7 +62,6 @@ async Task SKAgent() } } } -#pragma warning restore SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. // Clean up await thread.DeleteAsync(); diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step01_Basics/AzureOpenAIResponses_Step01_Basics.csproj b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step01_Basics/AzureOpenAIResponses_Step01_Basics.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step01_Basics/AzureOpenAIResponses_Step01_Basics.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step01_Basics/AzureOpenAIResponses_Step01_Basics.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step01_Basics/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step01_Basics/Program.cs index 16969a23e4..22a17887e1 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step01_Basics/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step01_Basics/Program.cs @@ -6,9 +6,6 @@ using Microsoft.Agents.AI; using Microsoft.SemanticKernel.Agents.OpenAI; using OpenAI; -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); var deploymentName = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o"; var userInput = "Tell me a joke about a pirate."; diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step02_ReasoningModel/AzureOpenAIResponses_Step02_ReasoningModel.csproj b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step02_ReasoningModel/AzureOpenAIResponses_Step02_ReasoningModel.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step02_ReasoningModel/AzureOpenAIResponses_Step02_ReasoningModel.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step02_ReasoningModel/AzureOpenAIResponses_Step02_ReasoningModel.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs index 0aafea7a73..8ee5ae89b6 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs @@ -9,9 +9,6 @@ using Microsoft.SemanticKernel.Agents.OpenAI; using Microsoft.SemanticKernel.ChatCompletion; using OpenAI; -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); var deploymentName = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "o4-mini"; var userInput = diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step03_ToolCall/AzureOpenAIResponses_Step03_ToolCall.csproj b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step03_ToolCall/AzureOpenAIResponses_Step03_ToolCall.csproj index ee2d8995ad..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step03_ToolCall/AzureOpenAIResponses_Step03_ToolCall.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step03_ToolCall/AzureOpenAIResponses_Step03_ToolCall.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;CA1050;CA1052 diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step03_ToolCall/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step03_ToolCall/Program.cs index 1c5f30548e..12bb3b46b7 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step03_ToolCall/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step03_ToolCall/Program.cs @@ -8,8 +8,6 @@ using Microsoft.SemanticKernel; using Microsoft.SemanticKernel.Agents.OpenAI; using OpenAI; -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); var deploymentName = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o"; var userInput = "What is the weather like in Amsterdam?"; diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step04_DependencyInjection/AzureOpenAIResponses_Step04_DependencyInjection.csproj b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step04_DependencyInjection/AzureOpenAIResponses_Step04_DependencyInjection.csproj index 00fc38794f..9a9c652f30 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step04_DependencyInjection/AzureOpenAIResponses_Step04_DependencyInjection.csproj +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step04_DependencyInjection/AzureOpenAIResponses_Step04_DependencyInjection.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs index a6f10e19e3..e2bef86a7f 100644 --- a/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs @@ -8,8 +8,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.SemanticKernel.Agents.OpenAI; using OpenAI; -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); var deploymentName = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o"; var userInput = "Tell me a joke about a pirate."; diff --git a/dotnet/samples/SemanticKernelMigration/OpenAI/Step01_Basics/OpenAI_Step01_Basics.csproj b/dotnet/samples/SemanticKernelMigration/OpenAI/Step01_Basics/OpenAI_Step01_Basics.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAI/Step01_Basics/OpenAI_Step01_Basics.csproj +++ b/dotnet/samples/SemanticKernelMigration/OpenAI/Step01_Basics/OpenAI_Step01_Basics.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/OpenAI/Step02_ToolCall/OpenAI_Step02_ToolCall.csproj b/dotnet/samples/SemanticKernelMigration/OpenAI/Step02_ToolCall/OpenAI_Step02_ToolCall.csproj index 2ea901c66d..9a9c652f30 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAI/Step02_ToolCall/OpenAI_Step02_ToolCall.csproj +++ b/dotnet/samples/SemanticKernelMigration/OpenAI/Step02_ToolCall/OpenAI_Step02_ToolCall.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;CA1050;CA1052 diff --git a/dotnet/samples/SemanticKernelMigration/OpenAI/Step03_DependencyInjection/OpenAI_Step03_DependencyInjection.csproj b/dotnet/samples/SemanticKernelMigration/OpenAI/Step03_DependencyInjection/OpenAI_Step03_DependencyInjection.csproj index 00fc38794f..9a9c652f30 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAI/Step03_DependencyInjection/OpenAI_Step03_DependencyInjection.csproj +++ b/dotnet/samples/SemanticKernelMigration/OpenAI/Step03_DependencyInjection/OpenAI_Step03_DependencyInjection.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step01_Basics/OpenAIAssistants_Step01_Basics.csproj b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step01_Basics/OpenAIAssistants_Step01_Basics.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step01_Basics/OpenAIAssistants_Step01_Basics.csproj +++ b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step01_Basics/OpenAIAssistants_Step01_Basics.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step01_Basics/Program.cs b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step01_Basics/Program.cs index 4ff054ba2f..933e30bdce 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step01_Basics/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step01_Basics/Program.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - using Microsoft.Agents.AI; using Microsoft.SemanticKernel.Agents.OpenAI; using Microsoft.SemanticKernel.Connectors.OpenAI; diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step02_ToolCall/OpenAIAssistants_Step02_ToolCall.csproj b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step02_ToolCall/OpenAIAssistants_Step02_ToolCall.csproj index ee2d8995ad..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step02_ToolCall/OpenAIAssistants_Step02_ToolCall.csproj +++ b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step02_ToolCall/OpenAIAssistants_Step02_ToolCall.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;CA1050;CA1052 diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step02_ToolCall/Program.cs b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step02_ToolCall/Program.cs index 7046a28265..4daf7ee59d 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step02_ToolCall/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step02_ToolCall/Program.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - using System.ComponentModel; using Microsoft.Agents.AI; using Microsoft.Extensions.AI; diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step03_DependencyInjection/OpenAIAssistants_Step03_DependencyInjection.csproj b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step03_DependencyInjection/OpenAIAssistants_Step03_DependencyInjection.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step03_DependencyInjection/OpenAIAssistants_Step03_DependencyInjection.csproj +++ b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step03_DependencyInjection/OpenAIAssistants_Step03_DependencyInjection.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step03_DependencyInjection/Program.cs b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step03_DependencyInjection/Program.cs index 1ddac9ec1c..29fefbc0ad 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step03_DependencyInjection/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step03_DependencyInjection/Program.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - using Microsoft.Agents.AI; using Microsoft.Extensions.DependencyInjection; using Microsoft.SemanticKernel; diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step04_CodeInterpreter/OpenAIAssistants_Step04_CodeInterpreter.csproj b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step04_CodeInterpreter/OpenAIAssistants_Step04_CodeInterpreter.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step04_CodeInterpreter/OpenAIAssistants_Step04_CodeInterpreter.csproj +++ b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step04_CodeInterpreter/OpenAIAssistants_Step04_CodeInterpreter.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step04_CodeInterpreter/Program.cs b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step04_CodeInterpreter/Program.cs index 8ac1bb5a07..e89ac5e9fd 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step04_CodeInterpreter/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/OpenAIAssistants/Step04_CodeInterpreter/Program.cs @@ -9,9 +9,6 @@ using Microsoft.SemanticKernel.Agents.OpenAI; using OpenAI; using OpenAI.Assistants; -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. -#pragma warning disable CS8321 // Local function is declared but never used - var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); var model = System.Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o"; var userInput = "Create a python code file using the code interpreter tool with a code ready to determine the values in the Fibonacci sequence that are less then the value of 101"; @@ -49,7 +46,6 @@ async Task SKAgentAsync() foreach (var item in content.Message.Items) { // Process each item in the message -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. if (item is AnnotationContent annotation) { if (annotation.Kind != AnnotationKind.UrlCitation) @@ -61,7 +57,6 @@ async Task SKAgentAsync() { Console.WriteLine($" [{item.GetType().Name}] File #{fileReference.FileId}"); } -#pragma warning restore SKEXP0110 } } diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step01_Basics/OpenAIResponses_Step01_Basics.csproj b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step01_Basics/OpenAIResponses_Step01_Basics.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step01_Basics/OpenAIResponses_Step01_Basics.csproj +++ b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step01_Basics/OpenAIResponses_Step01_Basics.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step01_Basics/Program.cs b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step01_Basics/Program.cs index 5c6a501e10..9e7968df1c 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step01_Basics/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step01_Basics/Program.cs @@ -4,9 +4,6 @@ using Microsoft.Agents.AI; using Microsoft.SemanticKernel.Agents.OpenAI; using OpenAI; -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); var model = System.Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o"; var userInput = "Tell me a joke about a pirate."; diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step02_ReasoningModel/OpenAIResponses_Step02_ReasoningModel.csproj b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step02_ReasoningModel/OpenAIResponses_Step02_ReasoningModel.csproj index 7c97e7a05d..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step02_ReasoningModel/OpenAIResponses_Step02_ReasoningModel.csproj +++ b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step02_ReasoningModel/OpenAIResponses_Step02_ReasoningModel.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs index befe386495..ca93169f39 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs @@ -7,9 +7,6 @@ using Microsoft.SemanticKernel.Agents.OpenAI; using Microsoft.SemanticKernel.ChatCompletion; using OpenAI; -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); var model = System.Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "o4-mini"; var userInput = diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step03_ToolCall/OpenAIResponses_Step03_ToolCall.csproj b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step03_ToolCall/OpenAIResponses_Step03_ToolCall.csproj index ee2d8995ad..a91ff32320 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step03_ToolCall/OpenAIResponses_Step03_ToolCall.csproj +++ b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step03_ToolCall/OpenAIResponses_Step03_ToolCall.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;CA1050;CA1052 diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step03_ToolCall/Program.cs b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step03_ToolCall/Program.cs index c0dbc1c5cf..45807993b2 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step03_ToolCall/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step03_ToolCall/Program.cs @@ -6,8 +6,6 @@ using Microsoft.SemanticKernel; using Microsoft.SemanticKernel.Agents.OpenAI; using OpenAI; -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); var model = System.Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o"; var userInput = "What is the weather like in Amsterdam?"; diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step04_DependencyInjection/OpenAIResponses_Step04_DependencyInjection.csproj b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step04_DependencyInjection/OpenAIResponses_Step04_DependencyInjection.csproj index 00fc38794f..9a9c652f30 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step04_DependencyInjection/OpenAIResponses_Step04_DependencyInjection.csproj +++ b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step04_DependencyInjection/OpenAIResponses_Step04_DependencyInjection.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - $(NoWarn);CA1812;RCS1102;CA1707;VSTHRD200 diff --git a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs index 6859f2c385..782f6eff57 100644 --- a/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs +++ b/dotnet/samples/SemanticKernelMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs @@ -6,8 +6,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.SemanticKernel.Agents.OpenAI; using OpenAI; -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); var model = System.Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o"; var userInput = "Tell me a joke about a pirate."; diff --git a/dotnet/src/LegacySupport/CompilerFeatureRequiredAttribute/CompilerFeatureRequiredAttribute.cs b/dotnet/src/LegacySupport/CompilerFeatureRequiredAttribute/CompilerFeatureRequiredAttribute.cs index 74a67d7c6e..f16a84e4fe 100644 --- a/dotnet/src/LegacySupport/CompilerFeatureRequiredAttribute/CompilerFeatureRequiredAttribute.cs +++ b/dotnet/src/LegacySupport/CompilerFeatureRequiredAttribute/CompilerFeatureRequiredAttribute.cs @@ -12,7 +12,7 @@ internal sealed class CompilerFeatureRequiredAttribute : Attribute { public CompilerFeatureRequiredAttribute(string featureName) { - FeatureName = featureName; + this.FeatureName = featureName; } /// diff --git a/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs b/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs index 8eb4839ae0..e80c5c8fc3 100644 --- a/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs @@ -35,7 +35,7 @@ public abstract class AIAgent /// agent instances in multi-agent scenarios. They should remain stable for the lifetime /// of the agent instance. /// - public virtual string Id => _id; + public virtual string Id => this._id; /// /// Gets the human-readable name of the agent. diff --git a/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgentMetadata.cs b/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgentMetadata.cs index e7923f4e78..f5f7d34c1c 100644 --- a/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgentMetadata.cs +++ b/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgentMetadata.cs @@ -20,7 +20,7 @@ public class AIAgentMetadata /// public AIAgentMetadata(string? providerName = null) { - ProviderName = providerName; + this.ProviderName = providerName; } /// diff --git a/dotnet/src/Microsoft.Agents.AI.Abstractions/AIContextProvider.cs b/dotnet/src/Microsoft.Agents.AI.Abstractions/AIContextProvider.cs index e850b4068f..337cfae2e2 100644 --- a/dotnet/src/Microsoft.Agents.AI.Abstractions/AIContextProvider.cs +++ b/dotnet/src/Microsoft.Agents.AI.Abstractions/AIContextProvider.cs @@ -136,7 +136,7 @@ public abstract class AIContextProvider /// is . public InvokingContext(IEnumerable requestMessages) { - RequestMessages = requestMessages ?? throw new ArgumentNullException(nameof(requestMessages)); + this.RequestMessages = requestMessages ?? throw new ArgumentNullException(nameof(requestMessages)); } /// @@ -166,7 +166,7 @@ public abstract class AIContextProvider /// is . public InvokedContext(IEnumerable requestMessages) { - RequestMessages = requestMessages ?? throw new ArgumentNullException(nameof(requestMessages)); + this.RequestMessages = requestMessages ?? throw new ArgumentNullException(nameof(requestMessages)); } /// diff --git a/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunResponse.cs b/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunResponse.cs index fdae328956..5cf3687046 100644 --- a/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunResponse.cs +++ b/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunResponse.cs @@ -17,9 +17,6 @@ using System.Text.Json.Serialization.Metadata; using Microsoft.Shared.Diagnostics; using Microsoft.Extensions.AI; -#pragma warning disable S109 // Magic numbers should not be used -#pragma warning disable S1121 // Assignments should not be made from within sub-expressions - namespace Microsoft.Agents.AI; /// diff --git a/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunResponseExtensions.cs b/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunResponseExtensions.cs index a428fbc21d..87ce3ea495 100644 --- a/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunResponseExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentRunResponseExtensions.cs @@ -8,9 +8,6 @@ using System.Threading.Tasks; using Microsoft.Extensions.AI; using Microsoft.Shared.Diagnostics; -#pragma warning disable S109 // Magic numbers should not be used -#pragma warning disable S1121 // Assignments should not be made from within sub-expressions - namespace Microsoft.Agents.AI; /// diff --git a/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentThreadMetadata.cs b/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentThreadMetadata.cs index 6c0d92d8e7..e925c590fc 100644 --- a/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentThreadMetadata.cs +++ b/dotnet/src/Microsoft.Agents.AI.Abstractions/AgentThreadMetadata.cs @@ -13,7 +13,7 @@ public class AgentThreadMetadata /// The unique identifier for the conversation, if available. public AgentThreadMetadata(string? conversationId) { - ConversationId = conversationId; + this.ConversationId = conversationId; } /// diff --git a/dotnet/src/Microsoft.Agents.AI.Abstractions/Microsoft.Agents.AI.Abstractions.csproj b/dotnet/src/Microsoft.Agents.AI.Abstractions/Microsoft.Agents.AI.Abstractions.csproj index 0392c5d71c..4add7f427c 100644 --- a/dotnet/src/Microsoft.Agents.AI.Abstractions/Microsoft.Agents.AI.Abstractions.csproj +++ b/dotnet/src/Microsoft.Agents.AI.Abstractions/Microsoft.Agents.AI.Abstractions.csproj @@ -4,7 +4,7 @@ $(ProjectsTargetFrameworks) $(ProjectsDebugTargetFrameworks) Microsoft.Agents.AI - $(NoWarn);CA1716;IDE0009;MEAI001 + $(NoWarn);MEAI001 preview diff --git a/dotnet/src/Microsoft.Agents.AI.AzureAI/Microsoft.Agents.AI.AzureAI.csproj b/dotnet/src/Microsoft.Agents.AI.AzureAI/Microsoft.Agents.AI.AzureAI.csproj index 0ae9e4e903..9fcbc4c83f 100644 --- a/dotnet/src/Microsoft.Agents.AI.AzureAI/Microsoft.Agents.AI.AzureAI.csproj +++ b/dotnet/src/Microsoft.Agents.AI.AzureAI/Microsoft.Agents.AI.AzureAI.csproj @@ -5,7 +5,6 @@ $(ProjectsDebugTargetFrameworks) preview enable - $(NoWarn);IDE0009; diff --git a/dotnet/src/Microsoft.Agents.AI.Hosting.A2A.AspNetCore/Microsoft.Agents.AI.Hosting.A2A.AspNetCore.csproj b/dotnet/src/Microsoft.Agents.AI.Hosting.A2A.AspNetCore/Microsoft.Agents.AI.Hosting.A2A.AspNetCore.csproj index fb2368591c..115187398d 100644 --- a/dotnet/src/Microsoft.Agents.AI.Hosting.A2A.AspNetCore/Microsoft.Agents.AI.Hosting.A2A.AspNetCore.csproj +++ b/dotnet/src/Microsoft.Agents.AI.Hosting.A2A.AspNetCore/Microsoft.Agents.AI.Hosting.A2A.AspNetCore.csproj @@ -3,7 +3,6 @@ $(ProjectsCoreTargetFrameworks) $(ProjectsCoreTargetFrameworks) - $(NoWarn);IDE1006;IDE0130;NU1504 Microsoft.Agents.AI.Hosting.A2A.AspNetCore preview diff --git a/dotnet/src/Microsoft.Agents.AI.Hosting.A2A/Microsoft.Agents.AI.Hosting.A2A.csproj b/dotnet/src/Microsoft.Agents.AI.Hosting.A2A/Microsoft.Agents.AI.Hosting.A2A.csproj index 3adf0e6352..77aeb6b3bc 100644 --- a/dotnet/src/Microsoft.Agents.AI.Hosting.A2A/Microsoft.Agents.AI.Hosting.A2A.csproj +++ b/dotnet/src/Microsoft.Agents.AI.Hosting.A2A/Microsoft.Agents.AI.Hosting.A2A.csproj @@ -3,7 +3,6 @@ $(ProjectsCoreTargetFrameworks) $(ProjectsCoreTargetFrameworks) - $(NoWarn);IDE1006;IDE0130;NU1504 Microsoft.Agents.AI.Hosting.A2A preview diff --git a/dotnet/src/Microsoft.Agents.AI.OpenAI/Microsoft.Agents.AI.OpenAI.csproj b/dotnet/src/Microsoft.Agents.AI.OpenAI/Microsoft.Agents.AI.OpenAI.csproj index 9753d4be08..3c79bb3071 100644 --- a/dotnet/src/Microsoft.Agents.AI.OpenAI/Microsoft.Agents.AI.OpenAI.csproj +++ b/dotnet/src/Microsoft.Agents.AI.OpenAI/Microsoft.Agents.AI.OpenAI.csproj @@ -4,7 +4,7 @@ $(ProjectsTargetFrameworks) $(ProjectsDebugTargetFrameworks) preview - $(NoWarn);IDE0009;OPENAI001; + $(NoWarn);OPENAI001; enable true diff --git a/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs b/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs index 226cf18d2c..a6a3e248b4 100644 --- a/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs @@ -12,8 +12,6 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Shared.Diagnostics; -#pragma warning disable S3358 // Ternary operators should not be nested - namespace Microsoft.Agents.AI; /// diff --git a/dotnet/tests/.editorconfig b/dotnet/tests/.editorconfig index 2554dbdc7c..e3ee57d9ba 100644 --- a/dotnet/tests/.editorconfig +++ b/dotnet/tests/.editorconfig @@ -1,7 +1,13 @@ # Suppressing errors for Test projects under dotnet/tests folder [*.cs] -dotnet_diagnostic.CA1707.severity = none # Underscores in method names dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task + dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member + dotnet_diagnostic.IDE1006.severity = warning # Naming rule violations + dotnet_diagnostic.VSTHRD111.severity = none # Use .ConfigureAwait(bool) is hidden by default, set to none to prevent IDE from changing on autosave + +dotnet_diagnostic.MEAI001.severity = none # [Experimental] APIs in Microsoft.Extensions.AI +dotnet_diagnostic.OPENAI001.severity = none # [Experimental] APIs in OpenAI +dotnet_diagnostic.SKEXP0110.severity = none # [Experimental] APIs in Microsoft.SemanticKernel \ No newline at end of file diff --git a/dotnet/tests/Microsoft.Agents.AI.Abstractions.UnitTests/AIAgentTests.cs b/dotnet/tests/Microsoft.Agents.AI.Abstractions.UnitTests/AIAgentTests.cs index c2de14b05c..bfa14a89d4 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Abstractions.UnitTests/AIAgentTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Abstractions.UnitTests/AIAgentTests.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -#pragma warning disable S3717 // Track use of "NotImplementedException" - using System; using System.Collections.Generic; using System.Linq; diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.Tests/Microsoft.Agents.AI.Hosting.A2A.Tests.csproj b/dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.Tests/Microsoft.Agents.AI.Hosting.A2A.Tests.csproj index 41f9098c99..9b061c0c46 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.Tests/Microsoft.Agents.AI.Hosting.A2A.Tests.csproj +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.Tests/Microsoft.Agents.AI.Hosting.A2A.Tests.csproj @@ -2,7 +2,6 @@ $(ProjectsCoreTargetFrameworks) - $(NoWarn);NU1504 diff --git a/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIAssistantClientExtensionsTests.cs b/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIAssistantClientExtensionsTests.cs index f90e82c31d..743cadabc4 100644 --- a/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIAssistantClientExtensionsTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIAssistantClientExtensionsTests.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates - using System; using System.ClientModel; using System.ClientModel.Primitives; diff --git a/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIResponseClientExtensionsTests.cs b/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIResponseClientExtensionsTests.cs index a2899a1717..2612f4bfa9 100644 --- a/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIResponseClientExtensionsTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIResponseClientExtensionsTests.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -#pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates - using System; using System.Collections.Generic; using System.Runtime.CompilerServices; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeCodeGenTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeCodeGenTest.cs index 7650bab18a..ce64b95e64 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeCodeGenTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/DeclarativeCodeGenTest.cs @@ -31,13 +31,13 @@ public sealed class DeclarativeCodeGenTest(ITestOutputHelper output) : WorkflowT protected override async Task RunAndVerifyAsync(Testcase testcase, string workflowPath, DeclarativeWorkflowOptions workflowOptions) { - const string workflowNamespace = "Test.WorkflowProviders"; - const string workflowPrefix = "Test"; + const string WorkflowNamespace = "Test.WorkflowProviders"; + const string WorkflowPrefix = "Test"; - string workflowProviderCode = DeclarativeWorkflowBuilder.Eject(workflowPath, DeclarativeWorkflowLanguage.CSharp, workflowNamespace, workflowPrefix); + string workflowProviderCode = DeclarativeWorkflowBuilder.Eject(workflowPath, DeclarativeWorkflowLanguage.CSharp, WorkflowNamespace, WorkflowPrefix); try { - WorkflowEvents workflowEvents = await WorkflowHarness.RunCodeAsync(workflowProviderCode, $"{workflowPrefix}WorkflowProvider", workflowNamespace, workflowOptions, (TInput)GetInput(testcase)); + WorkflowEvents workflowEvents = await WorkflowHarness.RunCodeAsync(workflowProviderCode, $"{WorkflowPrefix}WorkflowProvider", WorkflowNamespace, workflowOptions, (TInput)GetInput(testcase)); foreach (ExecutorEvent invokeEvent in workflowEvents.ExecutorInvokeEvents) { this.Output.WriteLine($"EXEC: {invokeEvent.ExecutorId}"); diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/AgentFactory.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/AgentFactory.cs index c9427fdb52..56ba6e532d 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/AgentFactory.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/AgentFactory.cs @@ -20,11 +20,9 @@ using Shared.IntegrationTests; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Framework; -#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. - internal static class AgentFactory { - private static readonly Dictionary _agentDefinitions = + private static readonly Dictionary s_agentDefinitions = new() { ["FOUNDRY_AGENT_TEST"] = "TestAgent.yaml", @@ -56,7 +54,7 @@ internal static class AgentFactory AzureAIAgentFactory factory = new(); string repoRoot = WorkflowTest.GetRepoFolder(); - return s_agentMap = (await Task.WhenAll(_agentDefinitions.Select(kvp => CreateAgentAsync(kvp.Key, kvp.Value, cancellationToken)))).ToFrozenDictionary(t => t.Name, t => t.Id); + return s_agentMap = (await Task.WhenAll(s_agentDefinitions.Select(kvp => CreateAgentAsync(kvp.Key, kvp.Value, cancellationToken)))).ToFrozenDictionary(t => t.Name, t => t.Id); async Task<(string Name, string? Id)> CreateAgentAsync(string id, string file, CancellationToken cancellationToken) { diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.csproj b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.csproj index 3d189855ed..19b155d7d2 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.csproj +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.csproj @@ -2,7 +2,6 @@ $(ProjectsTargetFrameworks) - $(NoWarn);IDE1006 diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Extensions/ObjectExtensionsTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Extensions/ObjectExtensionsTests.cs index c2d8d49f82..d7610c3312 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Extensions/ObjectExtensionsTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Extensions/ObjectExtensionsTests.cs @@ -28,11 +28,11 @@ public sealed class ObjectExtensionsTests [Fact] public void AsListWithSingleElement() { - const string value = "Test"; - IList? result = value.AsList(); + const string Value = "Test"; + IList? result = Value.AsList(); Assert.NotNull(result); Assert.Single(result); - Assert.Equal(value, result[0]); + Assert.Equal(Value, result[0]); } [Fact] @@ -88,7 +88,7 @@ public sealed class ObjectExtensionsTests [Fact] public void ConvertJson() { - const string json = + const string Json = """ { "id": "item1", @@ -101,7 +101,7 @@ public sealed class ObjectExtensionsTests { "id", "item1"}, { "count", 5}, }; - VerifyConversion(json, VariableType.Record(("id", typeof(string)), ("count", typeof(int))), expected); + VerifyConversion(Json, VariableType.Record(("id", typeof(string)), ("count", typeof(int))), expected); } private static void VerifyConversion(object? sourceValue, VariableType targetType, object? expectedValue) diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests.csproj b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests.csproj index b2dda55e21..4eca981e33 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests.csproj +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests.csproj @@ -2,7 +2,6 @@ $(ProjectsTargetFrameworks) - $(NoWarn);IDE1006