Update Threading.Analyzers and fix VSTHRD200 issue (#6834)

This commit is contained in:
Joel Mut 2024-08-05 11:17:50 -03:00 коммит произвёл GitHub
Родитель 2ba4197299
Коммит 3f3cb7401c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 24 добавлений и 24 удалений

Просмотреть файл

@ -119,7 +119,7 @@
</ItemGroup>
<ItemGroup>
<Analyzer Include="packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\analyzers\cs\Microsoft.VisualStudio.SDK.Analyzers.dll" />
<Analyzer Include="packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\analyzers\cs\Microsoft.VisualStudio.Threading.Analyzers.dll" />
<Analyzer Include="packages\Microsoft.VisualStudio.Threading.Analyzers.17.10.48\analyzers\cs\Microsoft.VisualStudio.Threading.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
@ -128,12 +128,12 @@
powershell Compress-Archive -Path '$(SolutionDir)UncompressedProjectTemplates\*' -DestinationPath $(ProjectDir)ProjectTemplates\Bot` Framework.zip -Force
</PreBuildEvent>
</PropertyGroup>
<Import Project="packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets" Condition="Exists('packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" />
<Import Project="packages\Microsoft.VisualStudio.Threading.Analyzers.17.10.48\build\Microsoft.VisualStudio.Threading.Analyzers.targets" Condition="Exists('packages\Microsoft.VisualStudio.Threading.Analyzers.17.10.48\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets'))" />
<Error Condition="!Exists('packages\Microsoft.VisualStudio.Threading.Analyzers.17.10.48\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.VisualStudio.Threading.Analyzers.17.10.48\build\Microsoft.VisualStudio.Threading.Analyzers.targets'))" />
<Error Condition="!Exists('packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\build\Microsoft.VisualStudio.SDK.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\build\Microsoft.VisualStudio.SDK.Analyzers.targets'))" />
<Error Condition="!Exists('packages\Microsoft.VSSDK.BuildTools.17.0.5232\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.VSSDK.BuildTools.17.0.5232\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('packages\Microsoft.VSSDK.BuildTools.17.0.5232\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.VSSDK.BuildTools.17.0.5232\build\Microsoft.VSSDK.BuildTools.targets'))" />

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.VisualStudio.SDK.Analyzers" version="15.8.33" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Threading.Analyzers" version="15.8.122" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Threading.Analyzers" version="17.10.48" targetFramework="net46" />
<package id="Microsoft.VSSDK.BuildTools" version="17.0.5232" targetFramework="net46" developmentDependency="true" />
</packages>

Просмотреть файл

@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="16.8.55">
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

Просмотреть файл

@ -204,7 +204,7 @@ namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Testing
userToken.Setup(adapter);
}
async Task Inspect(DialogContextInspector inspector)
async Task InspectAsync(DialogContextInspector inspector)
{
var di = new DialogInspector(Dialog, resourceExplorer);
var activity = new Activity();
@ -235,7 +235,7 @@ namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Testing
foreach (var testAction in Script)
{
await testAction.ExecuteAsync(adapter, callback, Inspect).ConfigureAwait(false);
await testAction.ExecuteAsync(adapter, callback, InspectAsync).ConfigureAwait(false);
}
}

Просмотреть файл

@ -747,7 +747,7 @@ namespace Microsoft.Bot.Builder.Dialogs.Declarative.Resources
cancelReloadToken.Cancel();
cancelReloadToken = new CancellationTokenSource();
Task.Delay(1000, cancelReloadToken.Token)
_ = Task.Delay(1000, cancelReloadToken.Token)
.ContinueWith(
t =>
{

Просмотреть файл

@ -351,24 +351,24 @@ namespace Microsoft.Bot.Builder
// If there are no callbacks registered, bypass the overhead of invoking them and send directly to the adapter
if (_onSendActivities.Count == 0)
{
return SendActivitiesThroughAdapter();
return SendActivitiesThroughAdapterAsync();
}
// Send through the full callback pipeline
return SendActivitiesThroughCallbackPipeline();
return SendActivitiesThroughCallbackPipelineAsync();
Task<ResourceResponse[]> SendActivitiesThroughCallbackPipeline(int nextCallbackIndex = 0)
Task<ResourceResponse[]> SendActivitiesThroughCallbackPipelineAsync(int nextCallbackIndex = 0)
{
// If we've executed the last callback, we now send straight to the adapter
if (nextCallbackIndex == _onSendActivities.Count)
{
return SendActivitiesThroughAdapter();
return SendActivitiesThroughAdapterAsync();
}
return _onSendActivities[nextCallbackIndex].Invoke(this, bufferedActivities, () => SendActivitiesThroughCallbackPipeline(nextCallbackIndex + 1));
return _onSendActivities[nextCallbackIndex].Invoke(this, bufferedActivities, () => SendActivitiesThroughCallbackPipelineAsync(nextCallbackIndex + 1));
}
async Task<ResourceResponse[]> SendActivitiesThroughAdapter()
async Task<ResourceResponse[]> SendActivitiesThroughAdapterAsync()
{
if (Activity.DeliveryMode == DeliveryModes.ExpectReplies)
{
@ -453,12 +453,12 @@ namespace Microsoft.Bot.Builder
var conversationReference = Activity.GetConversationReference();
var a = activity.ApplyConversationReference(conversationReference);
async Task<ResourceResponse> ActuallyUpdateStuff()
async Task<ResourceResponse> ActuallyUpdateStuffAsync()
{
return await Adapter.UpdateActivityAsync(this, a, cancellationToken).ConfigureAwait(false);
}
return await UpdateActivityInternalAsync(a, _onUpdateActivity, ActuallyUpdateStuff, cancellationToken).ConfigureAwait(false);
return await UpdateActivityInternalAsync(a, _onUpdateActivity, ActuallyUpdateStuffAsync, cancellationToken).ConfigureAwait(false);
}
/// <summary>
@ -484,12 +484,12 @@ namespace Microsoft.Bot.Builder
var cr = Activity.GetConversationReference();
cr.ActivityId = activityId;
async Task ActuallyDeleteStuff()
async Task ActuallyDeleteStuffAsync()
{
await Adapter.DeleteActivityAsync(this, cr, cancellationToken).ConfigureAwait(false);
}
await DeleteActivityInternalAsync(cr, _onDeleteActivity, ActuallyDeleteStuff, cancellationToken).ConfigureAwait(false);
await DeleteActivityInternalAsync(cr, _onDeleteActivity, ActuallyDeleteStuffAsync, cancellationToken).ConfigureAwait(false);
}
/// <summary>
@ -514,12 +514,12 @@ namespace Microsoft.Bot.Builder
throw new ArgumentNullException(nameof(conversationReference));
}
async Task ActuallyDeleteStuff()
async Task ActuallyDeleteStuffAsync()
{
await Adapter.DeleteActivityAsync(this, conversationReference, cancellationToken).ConfigureAwait(false);
}
await DeleteActivityInternalAsync(conversationReference, _onDeleteActivity, ActuallyDeleteStuff, cancellationToken).ConfigureAwait(false);
await DeleteActivityInternalAsync(conversationReference, _onDeleteActivity, ActuallyDeleteStuffAsync, cancellationToken).ConfigureAwait(false);
}
/// <summary>
@ -574,7 +574,7 @@ namespace Microsoft.Bot.Builder
}
// Default to "No more Middleware after this".
async Task<ResourceResponse> Next()
async Task<ResourceResponse> NextAsync()
{
// Remove the first item from the list of middleware to call,
// so that the next call just has the remaining items to worry about.
@ -586,7 +586,7 @@ namespace Microsoft.Bot.Builder
// Grab the current middleware, which is the 1st element in the array, and execute it
UpdateActivityHandler toCall = updateHandlers.First();
return await toCall(this, activity, Next).ConfigureAwait(false);
return await toCall(this, activity, NextAsync).ConfigureAwait(false);
}
private async Task DeleteActivityInternalAsync(
@ -614,7 +614,7 @@ namespace Microsoft.Bot.Builder
}
// Default to "No more Middleware after this".
async Task Next()
async Task NextAsync()
{
// Remove the first item from the list of middleware to call,
// so that the next call just has the remaining items to worry about.
@ -624,7 +624,7 @@ namespace Microsoft.Bot.Builder
// Grab the current middleware, which is the 1st element in the array, and execute it.
DeleteActivityHandler toCall = deleteHandlers.First();
await toCall(this, cr, Next).ConfigureAwait(false);
await toCall(this, cr, NextAsync).ConfigureAwait(false);
}
}
}