Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Azure - Error CS0433: The type 'IAsyncDisposable' exists in both 'Microsoft.Bcl.AsyncInterfaces,

$
0
0

I've added the IAsyncDisposable interface to one of the classes of my project.Everything works fine when using Visual Studio. I can compile and execute the application without any errors nor warnings.

But after committing the project to Azure and compiling there I get the following error:

##[error]..Web\Services\HubEventService.cs(13,41): Error CS0433: The type 'IAsyncDisposable' exists in both 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'D:\a\1\s...Web\Services\HubEventService.cs(13,41): error CS0433: The type 'IAsyncDisposable' exists in both 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [D:\a\1\s....Web\Services....Web.Services.csproj]Done Building Project "D:\a\1\s....Web\Services....Web.Services.csproj" (default targets) -- FAILED.Done Building Project "D:\a\1\s....Web\Client....Web.Client.csproj" (default targets) -- FAILED.Done Building Project "D:\a\1\s....Web....Web.sln" (default targets) -- FAILED.

The code I've changed is as follows:

    public class HubConnectionService : IAsyncDisposable{ ... public async ValueTask DisposeAsync()        {            if (HubConnection != null)            {                await HubConnection.DisposeAsync();                HubConnection = null;            }                        }}

Any ideas on what is going on?

Thank you.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>