Could not load file or assembly 'System.Text.Encoding.CodePages, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
See original GitHub issueRepro steps
Provide the steps required to reproduce the problem:
- Create function app project
- Install
System.Text.Encoding.CodePages
nuget package - Adding
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
to function - Run function app
Expected behavior
Function app is executed without error
Actual behavior
The following error occurs and the function cannot be executed.
[2021-01-15T07:00:17.378Z] A host error has occurred during startup operation 'e356b46a-f0fb-44a1-8494-df0ad91f3d36'.
[2021-01-15T07:00:17.380Z] FunctionApp34: Could not load file or assembly 'System.Text.Encoding.CodePages, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 指定されたファイルが見つかりません。.
Value cannot be null. (Parameter 'provider')
Known workarounds
- Adding
_FunctionsSkipCleanOutput
setting - Downgrade
System.Text.Encoding.CodePages
to v4.7.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:16 (3 by maintainers)
Top Results From Across the Web
EPPlus: System.Text.Encoding.CodePages.dll not found in ...
The ExcelPackage instanciation will raise the following error: "Could not load file or assembly 'System.Text.Encoding.CodePages, Version=5.0.0.0 ...
Read more >Azure Functions - Could not load file or assembly System. ...
Text.Encoding.CodePages, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Read more >Could not load file or assembly 'System.Text.Encoding. ...
Re: Could not load file or assembly 'System.Text.Encoding.CodePages, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b0.
Read more >Could not load file or assembly 'System.Text.Encoding. ...
Text.Encoding.CodePages, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.... I tracked down the File version ...
Read more >System.Text.Encoding.CodePages 7.0.0
Provides support for code-page based encodings, including Windows-1252, Shift-JIS, and GB2312. Commonly Used Types: System.Text.CodePagesEncodingProvider.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have the same problem. The publish targets remove a lot of stuff.
The System.Text.Encoding.CodePages.dll is copied into bin/runtime/netstandard2.0.
It seems like files under bin/runtime/** are not probed at all.
I’ve tried this with both V2 and V3 runtime, including pretty much all framework targets since netstandard2.0.
I managed to get the file copied to the bin folder locally with an extra target in my .csproj, but I couldn’t figure which target / filegroup / property to use in order to include the file in the .zip that is published.
So for now I grudgingly copy the file into the function’s bin folder using the kudu console.
Let me know if I can help by providing more details. Here’s my targets:
Why is this about to be closed? I am seeing the issue myself running latest Functions SDK 3.0.12