mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 13:34:59 +00:00
System.Text.Encoding.CodePages depencency problem #325
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Tealons on GitHub (Sep 10, 2018).
I have a MVC function that I'm migration to an Azure Function. During the migration, I ran in some kind of dependency problem:
FileLoadException: Could not load file or assembly 'System.Text.Encoding.CodePages, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Somehow there is a problem concerning netstandard2.0 and sharpcompress 0.22.0. I'm not sure what the cause is, but downgrading to 0.21.0 solved it.
Maybe I can help somebody to save the hours that I lost figuring this out. And maybe a fix can be created for 0.23.0?
If any extra information is needed, just let me know.
@adamhathcock commented on GitHub (Sep 10, 2018):
Looks like updating the CodePages version to 4.5.0 from 4.4.0 busted it.
I have a feeling it's to do with the recent stuff talking about now .NET 4.6.1 isn't really supported by .NET Standard 2.0 since it was retrofitted. Discussed around here: https://github.com/dotnet/standard/issues/481 or https://github.com/dotnet/standard/issues/514
There was a tweet thread I can't find but blamed it on that.
It looks like Azure Functions 2.0 is .NET Core so maybe try that :)
@Tealons commented on GitHub (Sep 10, 2018):
That's not possible (yet): https://github.com/Azure/Azure-Functions/issues/805
@adamhathcock commented on GitHub (Sep 10, 2018):
I don't see the issue if your libraries all target netstandard20. You should be targetting that with everything except the actual executable which could be netcoreapp20 or netcoreapp21.
I'm just guessing that the azure function itself is just a library (targetting netstandard20) since the instance is the loading the library to execute it. Azure Functions v1 is net461 or something and Azure Functions v2 is netcoreapp20.
@Tealons commented on GitHub (Sep 10, 2018):
In the issue I references, you can find a link to https://github.com/Azure/azure-functions-vs-build-sdk/issues/160#issuecomment-386402717. You can compile with targetframework netcoreapp20, but it crashes with a runtime error...
@andrx commented on GitHub (Dec 20, 2019):
Building lambda function for aws. have the same issue. when downgraded back to 4.5.1 started working.
@manfred-brands commented on GitHub (Jun 14, 2022):
We have the same issue where SharpCompress is the only project pulling in
System.Runtime.CompilerServices.Unsafeversion 5.0.0. Other code pulls in 4.5.3 (file version 4.0.4.1) through System.Memory.It doesn't look SharpCompress needs that later version.
@SplitGemini commented on GitHub (May 9, 2023):
.net 4.8 same
@SplitGemini commented on GitHub (May 21, 2023):
Any updates?