I installed the Azure.Identity(Latest) and Azure.Messaging.ServiceBus(latest) because I want to connect with Service bus using ManagedIdentity.
private readonly ServiceBusSender _sender;
private const string QUEUENAME = "test";
public QueueService()
{
var client = new ServiceBusClient(ConfigurationManager.AppSettings["ServiceBusNameSpace"], new ManagedIdentityCredential(clientId: ConfigurationManager.AppSettings["ManagedIdentityClientId"], null));
_sender = client.CreateSender(QUEUENAME);
}
After drafting code, I’m facing issue related to loading the assembly.
FileLoadException: 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 located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I tried to fix it with some steps
. Downloaded the latest version of System.Threading.Tasks.Extensions and point to the latest version.
But not able to resolve this, also unittests are failing due to dependency.
Anshul Sharma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.