Could not load file or assembly ‘System.Diagnostics.DiagnosticSource’, Version=6.0.0.0. The system cannot find the file specified

Background:- My project is of a class library having target framework .NET framework 4.8 and have installed the nuget Azure.Storage.Blobs(version 12.21.1 which is latest stable) in my class.

I’m encountering a problem with the nuget package dll of “System.Diagnostics.DiagnosticSource”. In my error logs it states the Version of the dll as 6.0.0.0 although Azure.Core utilizes version 6.0.0.1.
I checked packages.config, csproj, app.config (Having bindingRedirect as well) and all refer to the same package version i.e 6.0.0.1.

I turned the assembly fusion logs on and they have the following:-


`The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Windows\SysWOW64\dllhost.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = System.Diagnostics.DiagnosticSource, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
(Fully-specified)
LOG: Appbase = file:///C:/Windows/SysWOW64/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = dllhost.exe
Calling assembly : Azure.Storage.Blobs, Version=12.21.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8.
=

LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Diagnostics.DiagnosticSource, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/System.Diagnostics.DiagnosticSource.DLL.
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/System.Diagnostics.DiagnosticSource/System.Diagnostics.DiagnosticSource.DLL.
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/System.Diagnostics.DiagnosticSource.EXE.
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/System.Diagnostics.DiagnosticSource/System.Diagnostics.DiagnosticSource.EXE.
LOG: Attempting download of new URL file:///C:/Users/agtoluser/Desktop/AzureDLL/R71/System.Diagnostics.DiagnosticSource.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\agtoluser\Desktop\AzureDLL\R71\System.Diagnostics.DiagnosticSource.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: System.Diagnostics.DiagnosticSource, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Run-from-source setup phase failed with hr = 0x80131040.
LOG: Attempting download of new URL file:///C:/Users/agtoluser/Desktop/AzureDLL/R71/System.Diagnostics.DiagnosticSource/System.Diagnostics.DiagnosticSource.DLL.
LOG: Attempting download of new URL file:///C:/Users/agtoluser/Desktop/AzureDLL/R71/System.Diagnostics.DiagnosticSource.EXE.
LOG: Attempting download of new URL file:///C:/Users/agtoluser/Desktop/AzureDLL/R71/System.Diagnostics.DiagnosticSource/System.Diagnostics.DiagnosticSource.EXE.
LOG: All probing URLs attempted and failed.

*** Assembly Binder Log Entry  (8/1/2024 @ 2:57:53 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.`

When I downgrade my NuGet package from 6.0.0.1 to 6.0.0.0, I encounter a different error: “Could not load file or assembly ‘System.Diagnostics.DiagnosticSource, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’.”

Attempting to switch from version 6.0.0.0 to 4.0.4.0 results in a compatibility issue with “Azure.Core” and “Azure.Storage.Blobs,” which do not support System.Diagnostics.DiagnosticSource, Version=4.0.4.0. Despite having consistent references to version 6.0.0.1 in both my web.config and the app.config of my new DLL, the error persists.

There was a similar question on stackoverflow, I attempted using it’s solution as well that is removed xmlns from assemblyBinding tag in app.config
Earlier:

Now:

But still the error is showing up. Please suggets some way out.

New contributor

user26601038 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật