Could not load file or assembly X or one of its dependencies.

Performance freak
Search for a command to run...

Performance freak
No comments yet. Be the first to comment.
When you use Response.Redirect with its second parameter set to true, it triggers a call to Response.End() Response.Redirect("Login.aspx"); // default is true Response.Redirect("Login.aspx", true); // same as above This causes AS...

Using ThreadPool.QueueUserWorkItem: Helps bypass limitations when trying to run async code inside IHttpModule. Does not interfere with the ASP.NET pipeline. Email sending does not block the main thread. Calling SendMailAsync().Wait() is safe here...

Introduction In SQL Server, the bit data type is used to store boolean values (0 for false, 1 for true). However, when working with SQL Server in a .NET application using Entity Framework or LINQ to SQL, the bit field is automatically converted to a ...

System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.Thread.AbortInternal() To avoid the ThreadAbortException error when using Response.Redirect, setting the second parameter to false is generally sufficient. However,...

In Visual Studio;
Check "Auto-Generate binding redirects"
When this is selected, versions are specified in the web.config file after the Nuget package updates.
When is binding necessary?
If there is more than one of the same dll, it determines which version of this dll the project will use.
Nuget Package Management: In old projects, packages.config was used. PackageReference is now used in new projects.
Visual Studio - Tools - Nuget Package Manager - Package Manager Settings Nuget Package Manager - General - Under Package Management. Select Default package management format to : PackageReference
Information in Visual Studio Output :
Consider app.config remapping of assembly "Google.Apis, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab" from Version "1.67.0.0" [] to Version "1.68.0.0" [C:\Users\Ferhat.nuget\packages\google.apis\1.68.0\lib\net462\Google.Apis.dll] to solve conflict and get rid of warning.
Consider app.config remapping of assembly "Google.Apis.Auth, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab" from Version "1.67.0.0" [] to Version "1.68.0.0" [C:\Users\Ferhat.nuget\packages\google.apis.auth\1.68.0\lib\net462\Google.Apis.Auth.dll] to solve conflict and get rid of warning.
Consider app.config remapping of assembly "Google.Apis.Core, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab" from Version "1.67.0.0" [] to Version "1.68.0.0" [C:\Users\Ferhat.nuget\packages\google.apis.core\1.68.0\lib\net462\Google.Apis.Core.dll] to solve conflict and get rid of warning.
Consider app.config remapping of assembly "System.Runtime.CompilerServices.Unsafe, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.4.1" [] to Version "6.0.0.0" [C:\Users\Ferhat.nuget\packages\system.runtime.compilerservices.unsafe\6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll] to solve conflict and get rid of warning.
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Google.Apis" culture="neutral" publicKeyToken="4b01fa6e34db77ab" />
<bindingRedirect oldVersion="0.0.0.0-1.68.0.0" newVersion="1.68.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Auth" culture="neutral" publicKeyToken="4b01fa6e34db77ab" />
<bindingRedirect oldVersion="0.0.0.0-1.68.0.0" newVersion="1.68.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Core" culture="neutral" publicKeyToken="4b01fa6e34db77ab" />
<bindingRedirect oldVersion="0.0.0.0-1.68.0.0" newVersion="1.68.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Resource :
https://weblog.west-wind.com/posts/2014/Nov/29/Updating-Assembly-Redirects-with-NuGet