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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodetect failed installation and recover from it #758

Closed
belav opened this issue Nov 14, 2022 · 1 comment
Closed

Autodetect failed installation and recover from it #758

belav opened this issue Nov 14, 2022 · 1 comment

Comments

@belav
Copy link
Owner

belav commented Nov 14, 2022

There are instances where csharpier is partially installed and if fails to run. This is the output from VSCode

["WARN" - 5:05:10 PM] Exception while running 'dotnet csharpier --version' in C:\Users\<WITHHELD>\AppData\Local\CSharpier\0.20.0
"Cannot use file stream for [C:\\Users\\<WITHHELD>\\AppData\\Local\\CSharpier\\0.20.0\\.store\\csharpier\\0.20.0\\csharpier\\0.20.0\\tools\\net6.0\\any\\dotnet-csharpier.deps.json]: No such file or directory\r\nA fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\\Program Files\\dotnet\\'.\r\nFailed to run as a self-contained app.\r\n  - The application was run as a self-contained app because 'C:\\Users\\<WITHHELD>\\AppData\\Local\\CSharpier\\0.20.0\\.store\\csharpier\\0.20.0\\csharpier\\0.20.0\\tools\\net6.0\\any\\dotnet-csharpier.runtimeconfig.json' was not found.\r\n  - If this should be a framework-dependent app, add the 'C:\\Users\\<WITHHELD>\\AppData\\Local\\CSharpier\\0.20.0\\.store\\csharpier\\0.20.0\\csharpier\\0.20.0\\tools\\net6.0\\any\\dotnet-csharpier.runtimeconfig.json' file and specify the appropriate framework.\r\n"
["ERROR" - 5:05:10 PM] ,,Tool 'csharpier' is already installed.

["DEBUG" - 5:05:10 PM] returning NullCSharpierProcess because of the previous error when trying to set up a csharpier process

The extensions install csharpier to a custom directory because they keep the dotnet tool running in the background. If they kept csharpier running from the default location then a user will run into issues if they run commands to update csharpier.

Testing the install can be done with the following command

C:\Users\[USER]\AppData\Local\CSharpier\[Version]\dotnet-csharpier --version`

Deleting that directory and restarting VSCode would get the extension to reinstall csharpier in the custom location.

It should be possible for the extensions to detect this and attempt to delete and reinstall csharpier.

@belav
Copy link
Owner Author

belav commented Jun 30, 2023

I did this a while ago and forgot to close the issue

@belav belav closed this as completed Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant