A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found - visual-studio-code

I tried internet search on this issue and it is very common with many suggestions. The problem started with an update to VS2019 in which I paused because my projects in VSCode were breaking.I did a system restore and when I tried to start VSCode I got a message saying my installation was corrupt. So I reinstalled to the latest version and now get this error.
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found...
I found 3 extensions that needed updating so I do so but did not fix this problem. Do not know if I need to update the .Net Core since it looks like a version mismatch. It seems these updates are wreckless since they always cause thing to go wrong.s

If you are facing this problem, it means you are using Windows.
This official microsoft live share github page explains how to fix the issue: https://github.com/MicrosoftDocs/live-share/issues/102
Especially, check out this comment: https://github.com/MicrosoftDocs/live-share/issues/102#issuecomment-366509735
make vscode is up to date
uninstall live share from vscode
close vscode completely
restart vscode as administrator
reinstall live share
I should add:
close completely vscode and restart it

Related

esp-idf build fails with "fatal error: esp_wifi.h: No such file or directory"

I am a student who has gotten a part time job embedded system programming. I am given a program the company uses, and asked to understand it. This is a working program. Therefore, the project can be built and flashed on ESP32 by the developers with no problem. So, the code and CMake files should have no issues. However, I cannot build the program either with VSCode extension nor with idf.py. In fact, I cannot build esp-idf examples from the official website, either.
Note: I am new to StackOverflow as well as to ESP32, so sorry if I made any mistakes here. If this post is problematic in any way, please inform me.
The error message from the terminal is shown here
I was initially using VSCode on Windows 10 (Windows is not activated). At first, ESP extension was completely failing to start the building process because it could not locate the tools. I was getting "could not be located" errors for all the tools. Below is a list of what I did in this setting:
I had v5.0.0 for esp-idf downloaded from Espressif server. I deleted it and tried v4.3.3 and then I tried to download from Github server. I downloaded the requirements for idf.py scripting environment and completed the settings for it as described by the Espressif's documentation.
I manually set the environment variables for IDF_PATH and PATH for both the user and for the system.
After 2, the initial error was gone. Unfortunately, I had a new error which indicated that ".elf" file for the project output could not be found. I do not exactly recall the error but if it is integral to the problem's solution I can try to replicate this issue.
I tried to delete and reinstall VSCode. I tried running VSCode with admin authority.
I tried changing the IDF_TOOLS_PATH in the VSCode esp-idf extension configurations from ".espressif" to "esp\esp-idf".
At this point, I moved to try to build the project on Ubuntu 22.04.1 LTS:
In Ubuntu, I got the fatal error: esp_event.h: No such file or directory error.
It does not seem to be a common issue and I could not find much about it online.
I followed the Linux setup steps in the documentation. It said that only step 1 (Downloading the prerequisites) was necessary for the VSCode extension.
I decided to try the "master branch" from esp-idf configurations as well. After I downloaded the master branch, the error changed to the current version: 'fatal error: esp_wifi.h: No such file or directory'
I also tried the idf.py in Ubuntu but I got the same error.
Both in Ubuntu and in Windows, the Doctor Command returns nothing. It does not even open the terminal or any window. I am not sure what it should return but some online discussions were asking about its return so I wanted to note it here.
Edit: When I tried the examples on Ubuntu, they actually build just fine. Doctor Command also works with examples.
However, the main code has still issues. Initially, I assumed I made some mistakes with esp-idf configurations. But, perhaps that was not the case.
I had the same problem and ended up editing my project's CMakeLists.txt. When I added "esp_wifi" to the "REQUIRES" list, it worked for me:
idf_component_register(
SRCS "main.c"
INCLUDE_DIRS res
EMBED_FILES res/settings.html
REQUIRES esp_wifi
)

Why am I getting an error when loading webviews in VS Code?

I'm using a portable install of VS Code 1.56.1 on Windows 10. Whenever open an extension from the marketplace, I get the following error:
Error loading webview: Error: Could not register service workers: TypeError: Failed to register a ServiceWorker for scope ('vscode-webview://extensioneditor/') with script ('vscode-webview://extensioneditor/service-worker.js?platform=electron&id=extensionEditor&vscode-resource-origin=https%3A%2F%2FextensionEditor.vscode-webview-test.com'): ServiceWorker cannot be started.
Same thing happens for other things using webviews, with a slightly different path (like VS Code release notes). I'm able to install plugins and view the Feature Contributions tab, but I cannot view the Details and Changelog tabs.
Any thoughts on what could be causing this? This is on a managed machine where security settings might be changing. I'm using a portable install because my installed version stopped working out of the blue last week and this was supposed to be the workaround until that was figured out.
I was getting the same error, it looks like an issue introduced on version 1.56.0.
For me the fix was running VS Code without elevated permissions.
I always run as administrator and running without it fixed the issue for me.
I had this problem, in terminal use code . --no-sandbox
Updating python3 to the most recent version may also help.

Is there a way to retrieve user settings from a corrupt VS Code?

I have Visual Studio Code 1.27.2 on Windows 10.
Background:
Recently there was an issue in the system not related to VS, and I had to run system repair which seems to have messed up with the settings of various programs, including VS.
Current situation:
Now when I open VS I get this:
title bar of VS with 'Unsupported' at the end
warning: "Your Code installation appears to be corrupt. Please reinstall."
According to the official FAQ, this can be due to fishy extensions. But this seems unlikely given that the last extension I installed was more than a week before this incident, and more importantly because of the system-wide settings shake-up.
Main issue:
When I try to access settings directly, I get another strange error:
warning: "Unable to open 'User Settings': e.replace is not a function (2 errors in total)."
This function didn't look familiar so I looked it up and it was in the doxygen code, which has not changed for weeks, so also don't think this is the real issue.
I tried the suggestions here but there was nothing found in my folders.
I plan on re-installing in all cases. It's not the end of the world if the settings are gone, but it would be great to ensure they are saved because I spent a lot of trial and error customizing them.

Eclipse save error when trying to open the design view of a synapse config file in WS02 Developer Studio

I'm following the tutorials and samples of the official WSO2 ESB documentation. When I create (or load) a synapse configuration in the WSO2 Developer Studio I'm getting the error as shown below:
Save problems
Save could not be completed.
Reason:
resources\sunErrorHandler.esb_diagram (The system cannot find the path specified)
This error shows up when I want to open anything in the Design view. Even when I'm not trying to save anything.
So far I have tried to add the path specified in the error, but without success. I already found a workaround to be able to save and deploy my ESB configurations. By using "Save as" I'm able to keep the changes I made in the XML files. However the error stills shows up when I open the new version of the file.
Does anyone know a better solution to permanently resolve this error message?
I had this problem as well, running eclipse.exe as administrator fixed it.
Issue remains unresolved for my Eclipse + DevStudio 3.8.0 install on a Windows 10 environment. However since I was experiencing some other issues with the WSO2 ESB I decided to migrate to a Linux (Ubuntu) environment. This seems to work much better, the eclipse does not seem to have this issue on Linux.
Eclipse want to write in C:\Program Files\eclipse\resources. I solve problem by adding full permissions to group users on folder C:\Program Files\eclipse
If this happens in Mac you can provide the required permission to the "/Applications/IntegrationStudio.app/Contents/MacOS/resources" folder.

Getting "Error: Failed to connect to OmniSharp"

I'm trying to get VSCode working with my Unity projects, and every time I select the Project icon (the little fire at the bottom) I get the following error:
Error: Failed to connect to OmniSharp
Is anyone else getting this?
You need to download the most recent version of "mono". Open up terminal and pass in brew install mono. Then "Pick a project" and select the ..-csharp.sln file and you should be up and running.
Ok, made some progress and gotten a few Unity projects working. It seems that you need some prerequisites installed, a clean up of your Unity project folder, and possibly some hand editing of your .sln and .csproj files.
I posted a (possibly) better answer over on Reddit. Hope that's not breaking stack etiquitte.
http://www.reddit.com/r/Unity3D/comments/34d6gc/visual_studio_for_mac_help_us_vote_for_unity/
i get this on windows when my project directory has a space in it
i removed the space and removed the error
i expect it will be fixed soom
I have a completely different answer: it's the runtime that VSCode is using. It doesn't match up with what it thinks it needs. I have to remember that we're still in beta and that things are changing rapidly. I had my dnvm running beta 7, but VSCode (and OmniSharp, by extension) is looking for beta 6, so it was failing. I updated my runtime using this this post as a clue. Now I have VSCode 0.7.0 using the beta 6 runtime. I have no idea how to tell what it's looking for...I just guessed based on when they were both released. HTH