Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot convert argument "entryNameEncoding", with value: "True", for "ExtractToDirectory" to type "System.Text.Encoding" #1006

Open
johnsimons opened this issue Feb 23, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@johnsimons
Copy link

Thank you 馃檱鈥嶁檧 for wanting to create an issue in this repository. Before you do, please ensure you are filing the issue in the right place. Issues should only be opened on if the issue relates to code in this repository.

If your issue is relevant to this repository, please include the information below:

Describe the bug
When the host has no .NetCore installed and no Powershell Core the tool cache api can throw the following error:

Cannot convert argument "entryNameEncoding", with value: "True", for "ExtractToDirectory" to type "System.Text.Encoding": "Cannot convert value "True" to type "System.Text.Encoding". Error: "Invalid cast from 'System.Boolean' to 'System.Text.Encoding'.""

The issue is because in this code, you are passing $true as the 3rd arg to ExtractToDirectory, but according to the https://docs.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile.extracttodirectory?view=netframework-4.8#overloads, in .NetFramework that argument is suppose to be the encoding, not a boolean.

To Reproduce
Steps to reproduce the behavior:

  1. Run the api mentioned above in a host without .netcore

Expected behavior
I expect it to extract the zip on the Windows host.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Window server 2012 R2
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant