Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) in visual studio - visual-studio

Am a newbie to windows 10 uwp having migrated from wpf applications. I know this question has been asked before but none has been able to solve my problem.
Recently, I attempted recreating the Hamburger menu for a uwp application I am creating by following the instructions on a GitHub page.
Everything was going on well till I encountered the error "Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ". After debugging, I realized the following line of code caused the error
<Setter Property="BorderBrush" Value="{x:Null}" />
Just to explain the project from the GitHub page; assuming you have a blank uwp xaml page, you have to add 2 files shell.xaml and shell.xaml.cs to your project as well as modifying the app.xaml. Further instructions are on the Github page. I added this but after running this I encountered the error.
I also tried the instructions from here but to no avail. Am quite confused with the explanation because I could not find the COMPONENTS as described on the page.
Please any suggestion will be helpful.

I encountered this Error: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) in Visual Studio 2017 when just changing the Solution Configuration from Debug to Release.
Fortunately, reopening Visual Studio eliminate this error.

Seems various causes lead to this error: in Visual Studio 2019 Community Edition (Studio Version 16.5.3) I added a Windows Form to an existing project, named it including the ending .cs - did not like that at all. I was not able to save the project, neither that specific file nor the project but was confronted with the 'catastrophic error...'. Luckly copy/past to Visual studio 2017 and past into newly added, blank form (that worked smoothly!) although the same problem occurred until I added the new form without suffix .cs!

No sure if this will help but I had the same error when creating a project in Visual Studio 2019.
So I tried changing the location where the project is created and it worked. Seemed the path was too long but Visual Studio gave this super unhelpful error instead of just saying the path is too long.
Anyways hope this helps atleast someone.

I faced the Same error in Visual Studio 2022; it took me 3 hours to resolve this problem.
I had no idea why this error occurred when I opened the View Designer of myForm.h file.
To resolve the problem, I deleted unnecessarily debug build folders from the project's repository. I only kept the single Debug directory and deleted the Release 64X and 84 directories. If you face the same problem, you can delete the unnecessary directory from your project repository and rebuild the project.

Related

Visual Studio IDE Error On Launch When Loading Project

I am loading my project into Visual Studio 2019 IDE. When I go into the forms designer within the IDE
Visual Studio Forms Designer has been gives me the following error:
An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch.
There is no code associated with it. All referenced DLLs haven't changed.
Has anyone else experienced this or have a work around as the Google searches I have done have given me to help. Is there a way to narrow down the error? I have also checked all the security dlls to make sure they are correct and are referenced locally to help. Maybe something to do with the CAS policy?
I have also tried on my installed versions of 2012, 2015, & 2017.
UPDATE: Updated the error above as I had the wrong error added.

The “GetDeploymentPathFromVsixManifest” task failed unexpectedly

What to do to solve "The “GetDeploymentPathFromVsixManifest” task failed unexpectedly" when trying to debug a VS extension project??
Same question was already asked multiple times with different source reasons, all for VS2017 usually for upgrading VS extensions from VS2015, and it should have been solved with VS 2019. Yet, it just popped up.
The "GetDeploymentPathFromVsixManifest" task failed unexpectedly.
System.TypeLoadException: Method 'get_JoinableTaskFactory' in type 'Microsoft.VisualStudio.Sdk.BuildTasks.ExtensionEngineHost' from assembly 'Microsoft.VisualStudio.Sdk.BuildTasks.16.0, Version=16.9.2017.12405, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' does not have an implementation.
at Microsoft.VisualStudio.Sdk.BuildTasks.ExtensionManagerUtilities.GetExtensionEngine(ISettingsManager manager, Boolean deletePendingUninstalls)
at Microsoft.VisualStudio.Sdk.BuildTasks.GetDeploymentPathFromVsixManifest.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
I have tried all the solution for the same error found on SO, so far to no avail. I am using VS 2019 Community 16.9.2, updated all packages, downgraded some to try, nothing really changes this error.
This is my first attempt on VSIX and I just downloaded an existing project from github and compiled it.
The github project is working (probably) since the extension is available on the marketplace.
Any other suggestions? Searches on this error in combination with the JoinableTaskFactory dont return exactly many results.
For me the solution was to do at least one of the following steps:
Delete the obj-folder in the project
Execute Reset the Visual Studio 2019 Experimental Instance. You can find this tool when you search it in the windows search bar.
Clean and Rebuild the project
Sometimes it helped if I did only one step and sometimes it only worked after doing all the steps.
I couldn't find out if there is a specific pattern behind, but doing all of the above steps always fixed the error for me.
Another issue where I got the same error was if there was the wrong external program selected under Project Properties -> Debug -> Start external Program. For VS2019 I need to select C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe
If I switched between Visual Studio Versions, then sometimes a different Visual Studio version was selected.
Uncheck: "Deploy VSIX content to experimental instance for debugging"
in solution properties->VSIX
Also Update installed NuGet packages.

Error starting Visual Studio 2017 - Error loading configuration file...IIS

This is not really a show stopper, but it is annoying. I recent switched from IIS Express to plain old IIS. Now when I start the debugger in Visual Studio I get the following error (my co-workers have had it for a long time, so it is not just me):
After you hit "OK" everything still debugs successfully. I have read a lot of articles that seem to suggest this is a privileges, but I have messed with privileges in the associated directories without being able to get rid of this. Any suggestions welcome.
I can show the contents of the config file at the lines specified, but I don't think that it the real issue.
Update
For those with the inability to see images clearly:
"The following error occured while getting connection string information from the configuration file." An error occurred loading a configuration file: Could not load file or assembly 'Microsoft.Configuration.ConfigurationBuilders.Azure, Version=1.0.0.0, Culture=Neutral' or one of its dependencies. The system cannot find the file specified. (C:\Users\me\Documents\myapp.web\myapp.Web\Web.config line 126)
I encountered a very similar error dialog, and opened an issue in the ConfigBuilders GitHub repository. According to Stephen Molloy from the team, this is a known issue with no good workaround other than to install Microsoft.Configuration.ConfigurationBuilders.Base.dll and Microsoft.Configuration.ConfigurationBuilders.[Azure|Environment|etc.].dll in a "findable" location, such as the GAC or the Visual Studio installation directories.

Visual Studio Extension: Build error VSSDK1043: "There was a prblem finding the extension with a VSIX identifier..."

I am trying to debug my extensions and suddenly I cannot build it anymore.
Error 1 There was a problem finding the extension with a VSIX
identifier of "1cdefdc6-1f5e-4027-9bb7-773248c65070". Illegal
characters in path.
I have rolled back all changes I made and still the error occurs. I don't think that I have changed any configuration.
This is not a dupliacte of: VSIX package build failed without showing the reason (Visual Studio bug) I have already tried those suggestions.
If I disabled
Deploy VSIX content to experimental instance for debugging
it compiles, but I cannot debug it.
Changing the Product ID also works, but this means, that it can no longer update the existing product.
I was getting the same error message (this is how i ended up hear) and then after changing the name i got the following error
VSIX development error VSSDK1040: There was a problem enabling the extension with a VSIX
Stumbled on the solution found here
What he did was delete this folder C:\Users\<UserName>\AppData\Local\Microsoft\VisualStudio
So i did that, am going to have to re-install a handful of extensions now as i am getting errors from them but it did correct my issue.
maybe you can dig a little deeper into the folder to find just the needed items to remove or do what i did and just nuke the folder and pick up the pieces
EDIT: from comments you may be able to get away with just removing anything under 'C:\Users\\AppData\Local\Microsoft\VisualStudio' with the EXP extension

Why do I get "An error occurred while validating. HRESULT = '80004005'" when building a setup project?

Why do I get the following error when building a setup project?
An error occurred while validating. HRESULT = '80004005'
One project in solution had ToolsVersion="4.0" (in .csproj file), changed it to ToolsVersion="3.5" and setup project builds fine.
Both of the reasons I found are already in other answers, but they are in separate answers and not fully explained. So, hopefully this will combine the possibilities and give good means of debugging each. :)
Common Reason
My problem was not a dependency error. However, that does seem to be the common reason. So, basically, you need to check your MSI file and make sure that all dependencies are still valid. Probably the best blog response on how you can easily resolve this if it is a dependency issue is An error occurred while validating. HRESULT = '80004005'.
Extract from blog:
Follow steps below to troubleshoot.
If you have multiple project outputs in your solution, identify the project that is giving the problem. You can do that by removing one project at a time from the Setup Project(S) until error goes away.
Once project is identified, identify the reference that could be giving the problem.
Check if the project(A) is referencing to a project that has been removed from solution. - Remove such references if any.
Check if the Project(A) is referencing to a project that was moved to a diffenrent physical location after it was added as a reference. - Remove and add such references.
Rebuild setup project after fixing the reference accordingly to see if error goes away.
Alternative Reason
My problem had to do with Visual Studio versioning, however. So, if your dependencies are valid and you still are getting this problem, then you resolve this if it is a problem with VS2010 .
Basically, if you run MSBuild and see this warning:
Project file contains ToolsVersion="4.0", which is not supported by
this version of MSBuild. Treating the project as if it had
ToolsVersion="3.5"
Then the problem is Visual Studio versioning. This means that one project was opened or created in Visual Studio 2010 and then saved or added to an existing 3.5 solution. I simply searched all files in my project for ToolsVersion="4.0" and found the offending .csproj file, opened it in a text editor and manually changed the 4.0 to a 3.5.
This error is related to a dependency error. I removed all references to my primary output project and added them again. It now compiles OK!
I ran up against this issue today. The solution in my case? Restart Visual Studio 2008.
In my case my solution (VS2008) had a project that was also referenced from another solution (VS2010). In the VS2010 solution I had upgraded the project to .NET 4.0. When I later realized the project was also used in another solution I downgraded it to .NET 3.5. For some reason everything seemed to be changed correctly in the csproj file except one place which is mentioned here: Error in setup project HRESULT = '80004005'
I know this is already solved somewhere else but I wanted to shed some light on this from another problem angle.
While simply removing and re-adding the project dependencies will work in many cases, it is important to note that:
The error message "An error occurred while validating. HRESULT=80004005."
usually happens when project is referenced to the other project which is
not added into the currect [sic] solution. Setup project only supports
dependency projects within same solution.1
I have spent enormous time on this one myself, though none of the above worked. But I have found another solution with a registry hack, you need to add a new DWORD (EnableOutOfProcBuild) value of (0) to HKCU\SOFTWARE\Microsoft\VisualStudio\14.0_Config\MSBuild\EnableOutOfProcBuild
Note: this is for Visual Studio 2015
In my case I had installed Visual Studio 2010 alongside Visual Studio 2008. My setup project, when opened in Visual Studio 2008 gave the same error, but was OK in Visual Studio 2010.
If copied to another machine that did not have Visual Studio 2010, but did have Visual Studio 2008, then it would compile.
I installed Visual Studio 2010 and converted the solutions to that version. Because of performance issues I changed my solutions back to Visual Studio 2008. Everything was better now but I got an error when I tried to compile the setup project. I realized that I had a Visual Studio 2010 Test Project in my solution so all I had to do was unload the Test Project and Build the setup project again.
Summary: unload any Visual Studio 2010 project in solution.
I hope it helps.
I know this is kinda old news, but my particular issue and solution are not specifically stated here (as far as I can tell - if I missed it, I apologize).
I had same problem. It would not compile my project, but had no errors. All I could see was "Build Failed". I opened up the "Output" file (Click View--> Output on menu), and it told me exactly which reference (in my case a .dll) was causing the problem.
I deleted and recreated the reference and it changed the reference name from Microsoft.Office.Core (which was appearently only a 32 bit version) to "OFFICE". Then everything worked great. -- Make sure to make a note of the path to the file you are referencing in the properties window... My new path was exactly the same, but the reference name changed anyway.... still scratching my head on that one...
So the moral of the story is... When you get no errors and your build fails, check the "Output" tab and it might help.
I read this answer from another post on Stack Overflow, and it has worked for me.
Open your setup project file (.vdproj) in Notepad (or any other text editor). Delete these lines at a beginning of the .vdproj file:
"SccProjectName" = "8:"
"SccLocalPath" = "8:"
"SccAuxPath" = "8:"
"SccProvider" = "8:"
Build again - the error is gone. That error didn't stop me from deploying, building, debugging (or anyting) my project; it just annoyed me. And it came on even if I set all projects to be build in a current configuration and the setup project not to.

Resources