System.Threading.Tasks.Extensions dependency error
See original GitHub issueHi, many thanks for the library, I’ve just installed SocketIOClient@1.0.3.12 (runtime version is v4.0.30319) via NuGet, I could build it successfully. But when I run the app, my app when crashed because of this error:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at System.Threading.Channels.SingleConsumerUnboundedChannel`1..ctor(Boolean runContinuationsAsynchronously)
at System.Threading.Channels.Channel.CreateUnbounded[T](UnboundedChannelOptions options)
at Websocket.Client.WebsocketClient..ctor(Uri url, Func`3 connectionFactory)
at SocketIOClient.SocketIO.ConnectAsync()
at cBot.Robots.BitQSignalExecutor.<initRemoteSignal>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
The program try to load System.Threading.Tasks.Extensions, Version=4.2.0.0
but the installed version is System.Threading.Tasks.Extensions, Version=4.5.4
, and release history has no version 4.2.0 !!
I’m using .NET 4.7.2 and add netstandard
as reference.
here my code, copied from your example:
using System.Threading.Tasks.Extensions; // ==> VS IDE highlight that no Extensions in System.Threading.Tasks
// --- here my class's function
public async void initRemoteSignal()
{
const string TEST_CHANNEL = "chat_message";
var client = new SocketIO("http://localhost:3000");
client.ConnectTimeout = TimeSpan.FromSeconds(5);
client.On(TEST_CHANNEL, args =>
{
string text = JsonConvert.DeserializeObject<string>(args.Text);
Console.WriteLine(args.Text);
});
client.OnConnected += async () =>
{
for (int i = 0; i < 5; i++)
{
await client.EmitAsync(TEST_CHANNEL, i.ToString());
await Task.Delay(1000);
}
await client.EmitAsync("close", "close");
};
client.OnClosed += Client_OnClosed;
await client.ConnectAsync();
}
I checked the project’s references and sawSystem.Threading.Tasks.Extensions
has already been there.
I think I got library interference issue, but I’m a new to C# .net so I dont know how to resolve this issue. Any suggestion are welcome!
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Unable to load System.Threading.Tasks.Extensions
System.Threading.Tasks.Extensions which is installed using Nuget is not getting loaded to the project. When I checked the properties of System.
Read more >Reference mismatch to System.Threading.Tasks.Extensions
My solution is manually add System.Threading.Tasks.Extensions nuget reference with nuget version 4.5.4 in ProjectA directly.
Read more >[Solved]-Unable to load System.Threading.Tasks.Extensions-C#
I got a similar error message - but for a different reason. In packages.config set by NUGET manager There was a ref for...
Read more >Could not load file or assembly 'System.Threading.Tasks. ...
I had the same problem today in a multi project solution, System.Threading.Tasks.Extensions got installed by embedding the Autofac package.
Read more >C# – Unable to load System.Threading.Tasks.Extensions
When I tried run the project and connect and get the data from the database, I am getting the following error saying FileNotFoundException:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I created a clean new project and I didn’t get any errors.
csproj
App.config
package.config
This issue has been fixed in the latest version
2.0.0
. If it has not been fixed, please reopen it.