-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference mismatch to System.Threading.Tasks.Extensions #1488
Comments
Resolved - seems to have a dependency on nuget Microsoft System.Threading.Tasks.Extensions |
NuGet should add that for you. What version of CsvHelper? |
That's what I thought - I'm using the latest version of CsvHelper and needed to add the Extensions manually. |
That's included for the 4.7 build. Maybe it's a fluke? CsvHelper/src/CsvHelper/CsvHelper.csproj Line 50 in 24d8d53
|
Hmm, i know it should but will it work for 4.7.2 also?
… On Mar 28, 2020, at 15:32, Josh Close ***@***.***> wrote:
That's included for the 4.7 build. Maybe it's a fluke?
https://github.com/JoshClose/CsvHelper/blob/24d8d5393d1c88f852fec32803419bf5a800f2b9/src/CsvHelper/CsvHelper.csproj#L50
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I'm experiencing the same issue. Last working version is 13.0.0 for me, with 4.7.2 .net as the framework. It is also the last one without the dependency on System.Threading.Tasks.Extensions. My guess is that it's something going wrong with the dependency definition for the package |
I had the same issue running CsvHelper 15.0.5, it seemed to be an incompatibility with System.Text.Json 4.7.2 (may have been 4.7.1). I had to downgrade System.Text.Json to 4.6.0. |
I had the same issue but not using CsvHelper, I believed it can be fixed by the same solution. ProjectA referenced a custom libraryB. 2 The above two libraries was used by libraryB, and when I check the nuget libraries list, I find libraryB depends on System.Threading.Tasks.Extensions with nuget version 4.5.4, which assembly version is 4.2.0.1 My solution is manually add System.Threading.Tasks.Extensions nuget reference with nuget version 4.5.4 in ProjectA directly. |
And you will encounter another similar issue, which report the wrong version for "System.Runtime.CompilerServices.Unsafe", it's required 4.0.6.0 version, which mapped to nuget version 4.7.0. 2 3 4 |
In conclusion, add the following two packages in Project directly(the project which reported the mismatch problem) <package id="System.Runtime.CompilerServices.Unsafe" version="4.7.0" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" /> And the nuget should add the following bindingRedirect for you automatically in config file <dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly> |
There is another issue for this. Does this help? #1462 |
@JoshClose, last week I had success employing a solution @MikeYeager suggested in issue #1462 (Closed), but today I'm yet again bit by this reference roundy-round. I've tried three times to replicate his solution with CSV v16, but it just keeps failing. I've tried to make heads or tails of what the answer is, specifically @chucklu's, but I'm just spinning. Is there a bottom-line solution to this that will allow me to release with confidence? |
@chrishildebran Where did you encounter this issue? |
@chucklu, im seeing this error during debuggin in Visual Studio. Cannot provide code. See attached collage of screenshots. |
I will say that reverting to a previously release's package config (CSV Helper 15.0.5, Microsoft.BCL.AsyncInterfaces 1.1.0, and System.Threading.Task.Extensions 4.5.2 is working. It would be nice to be able to upgrade without worrying though. |
@chrishildebran Please configure your visual studio, Tools-->Options-->Projects and Solutions-->Build And Run If it's possible, could you zip your bin folder with the dll files and upload it here, I would like to analysis the dependency of all dll files. |
Did you mean when you run the application directly, there is no problem? Then I guess it should be the problem of visual studio |
@JoshClose I find another version mismatch issue NuGet/Home#10302, and it might be bug of nuget. |
I changed all the references to exact version match. Between that and redirects, I think we should be good. |
In 27.2.1 I changed all the references to be >= the lowest version that CsvHelper needs. I changed the test project to use the latest version of every dependency and everything seems to work fine. |
With target framework 4.7.2 the latest Stable Version of CSVHelper still lookin for the Microsoft.Bcl.AsyncInterfaces verison 1.0.0.0. Even though the project contains Microsoft.Bcl.AsyncInterfaces 5.0.0. |
@dplabsindia Do you have the bindingRedirect configuration in your app.config or web.config? <runtime>
<assemblyBinding
xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime> |
We have this in web.config. But still the problem persists. CSVhelper looking for assembly 1.0.0.0 of bcl asyncinteraces. |
@dplabsindia It should not looking for assembly 1.0.0.0 of bcl asyncinteraces if you have the bindingRedirect in correct config file. Please troubleshooting why your project try to locate assembly 1.0.0.0 of bcl asyncinteraces by using Fuslogvw.exe https://github.com/awaescher/Fusion this tool is better than Microsoft provided Fuslogvw.exe |
@dplabsindia Any feedback about the bindingRedirect issue? Have you located the root cause with tool Fusion++ written by awaescher? |
Not able to use this tool. But I am sure, we have multiple app.config files and one web.config file. The reference is everywhere when we install the package. I can see the bindingRedirect in every .config file. Still, the csvhelper complaining and looking for the 1.0.0.0 version. |
@dplabsindia why can't you use Fusion++ tool? do you work on windows? maybe you can try the tool Fuslogvw.exe provided by Microsoft |
The tool expects SDK on the server. And several other permission issues for now. Meanwhile, I have gone through the in thread, #1597 (comment) . Assuming that by default the 4.7.2 target framework is looking for the 1.0.0.0 which is the runtime error as it is not able to find this version. All config files as the binding redirect,
Not sure of these but somewhere the redirect binding failed due to something. Thanks, |
Using 4.7.2
Not sure when this started but now we are getting the following and can no longer import any file.
`System.IO.FileLoadException: Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.1, 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)
File name: 'System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' ---> System.IO.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)
File name: 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
at CsvHelper.Configuration.CsvConfiguration..ctor(CultureInfo cultureInfo)`
The text was updated successfully, but these errors were encountered: