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
Could not load file or assembly 'System.Text.Encoding.CodePages, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. #7061
Comments
I have the same problem. The publish targets remove a lot of stuff. 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. Let me know if I can help by providing more details. Here's my targets: <Target Name="ForceCopyCodePages" AfterTargets="_FunctionsBuildCleanOutput">
<Message Importance="High" Text="Copying messed up deps to $(OutputPath)" />
<Copy SourceFiles="$(OutputPath)bin\runtimes\win\lib\netcoreapp2.0\System.Text.Encoding.CodePages.dll"
DestinationFolder="$(OutputPath)bin"/>
</Target>
<Target Name="ForcePublishCodePages" AfterTargets="_FunctionsPostPublish">
<Message Importance="High" Text="Copying messed up deps for publish to $(PublishDir)bin" />
<Copy SourceFiles="$(OutputPath)bin\runtimes\win\lib\netcoreapp2.0\System.Text.Encoding.CodePages.dll"
DestinationFolder="$(PublishDir)bin"/>
</Target> |
Hi @shibayan, Apologies for the delayed response, please let us know if you were able to find a solution to this, if not, we would like to reproduce your project to understand the error better, could you give us the repro steps or test Zip file if possible which can repro the error. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
@v-bbalaiagar The workaround is described in the first comment. |
@shibayan, the workaround is not in the first comment, as per my understanding the author of those targets tried them out but it didn't work. Note that I'm experiencing the same issue, and so far only workaround is to manually move the dll using kudo. |
@SOFSPEEL I have confirmed that it works with the first workaround I wrote. It's not wrong.
|
@shibayan thanks for the feedback as I was unclear as to which workaround you were referring to. Ultimately what fixed it for me was just doing this, which seems to prevent the deletion of the runtime dlls that now deploy to the wwwroot/bin folder Wondering why the need to 'Downgrade System.Text.Encoding.CodePages to v4.7.1'? I should add I'm targeting as follows: Thanks |
I have the same problem, except with System.IO.Pipelines, Version=5.0.0.0, while connecting to redis using the StackExchange.Redis 2.2.4 package. Adding <_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput> to the .csproj file resolves the issue of not being able to connect to Redis. BUT: it also causes the EventHubTrigger not to fire. When I remove it, the event hub trigger fires again, but connecting to redis throws the exception again. And what I need unfortunatly is to react to an event hubtrigger and read some date from redis to decide what to do with the event. Hope anybody can help mee, or at least that this scenario is considered while solving this issue. Kind regards, ps. When I look at the verbose logging I notice that this part of the logging: |
Hi @shibayan, We would like to know if you can close this issue or if you are still looking for a solution @rob4bertus ,Can you create a new issue by explaining your scenario as it looks like a different scenario and not duplicate |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
Why is this about to be closed? I am seeing the issue myself running latest Functions SDK 3.0.12 |
Please don't close this issue. A fix is needed so that the perpetual use of a workaround is not required. @kashimiz, @v-bbalaiagar can some one investigate the root cause and develop a fix? |
@aaronhudon ,@bryanknox The bot has closed the issue due to in-activity. We shall keep the issue open. |
It requires @shibayan This worked for me: <ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.12" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<FunctionsPreservedDependencies Include="System.Text.Encoding.CodePages.dll" />
</ItemGroup> @rob4bertus For Redis we were able to successfully replace our use of |
Thanks for the update. Currently (with some help :)) we have got it running with _FunctionsSkipCleanOutput. (We had to downgrade some dependencies to do that, but that's ok for us). When I have some time I will test this new option. Maybe version conflicts between dll's is one of the side effects you speak about? |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
Repro steps
Provide the steps required to reproduce the problem:
System.Text.Encoding.CodePages
nuget packageEncoding.RegisterProvider(CodePagesEncodingProvider.Instance);
to functionExpected behavior
Function app is executed without error
Actual behavior
The following error occurs and the function cannot be executed.
Known workarounds
_FunctionsSkipCleanOutput
settingSystem.Text.Encoding.CodePages
to v4.7.1The text was updated successfully, but these errors were encountered: