Visual Studio 2022 error: Exception from HRESULT: 0x800300FA (STG_E_ABNORMALAPIEXIT) - asp.net

I have an ASP.Net Web forms project in Visual Studio 2022. When I try to build it, an error message appears.
An API call exited abnormally. (Exception from HRESULT: 0x800300FA (STG_E_ABNORMALAPIEXIT))
This error also appears when I try to exit Visual Studio. I have to kill the process to proceed.
The same project works fine in Visual Studio 2019.
Any idea where to start? The error message is not very insightful.
I already tried setting the rights on the framework Temporary ASP.NET Files folder. I didn't help.
The issue is also only with one project - other projects work fine.
Is there a way I can get a Visual Studio log. Any ideal where this is stored for Visual Studio 2022?

Try deleting the .vs folder at the root of your project that fixed it for me

Vs22 is now x64 bits, and is the first such version to be so.
This also means we see a lot more issues and errors in regards to running your application as any CPU as opposed to forcing the project bit size.
It's not clear if you always forced the bit size, or perhaps your project say references unmanaged code that's say x32 bits.
So I would force and change the project to run as x32 bits if that was the settings in the past.
And in fact any CPU used to result in your application (f5) to run as x32 bits, now that default any CPU setting will result in a x64 but running and debug session.
You don't mention your current project settings, but I would try x32 bits, especially if you used any CPU in the past.

I had a same issue after recent Visual Studio 2022 update. Was not able to build, run, publish solution at all. To resolve it I just pushed all my changes into repo and cloned it to new folder.
Have no idea what was a root cause, but it helped...

I was able to get rid of the issue through a combination of the following:
Closed Visual Studio
Removed **/bin/** **/obj/**
Updated Visual Studio to the latest version
Removed the component cache: %USERPROFILE%\AppData\Local\Microsoft\VisualStudio\1x.0\ComponentModelCache
Removed all temporary files in %USERPROFILE%\AppData\Local\Temp
Those locations are also mentioned on the internets, but I didn't touch them:
%USERPROFILE%\AppData\Local\Microsoft\Team Foundation
%USERPROFILE%\AppData\Local\Microsoft\VisualStudio
%USERPROFILE%\AppData\Local\Microsoft\VSCommon

Related

ASP.Net Core 2 - IIS 502.5 Error

I am creating an ASP .Net Core (2.0) MVC application within Visual Studio 2017 which was working absolutely fine.
After turning off my computer yesterday and coming back to my application today, I now receive this browser error when I start the application in chrome without debugging.
Running dotnet run within the directory of the application, I can access the site just fine. It is just when I run it via Visual Studio/IIS Express I get this error.
HTTP Error 502.5 - Process Failure
The application builds and compiles just fine. I have also cleaned the solution.
Looking in the event logs I find:
Application 'MACHINE/WEBROOT/APPHOST/MYAPP' with
physical root 'C:\Users\Ben Hawkins\Desktop\Development Folder
\Dev\Website\Version_2\MYAPP\MYAPP\'
failed to start process with commandline 'C:\Program Files
(x86)\Microsoft Visual
Studio\2017\Community\Common7\IDE\Extensions\Microsoft\Web
Tools\ProjectSystem\VSIISExeLauncher.exe -argFile "C:\Users\Ben
Hawkins\AppData\Local\Temp\tmp3547.tmp"', ErrorCode = '0x80004005 :
0.
Within my output window in Visual Studio 2017 I recieve this message under
ASP NET CORE WebServer
Failed to initialize CoreCLR, HRESULT: 0x80131534
What I have tried:
Cleaning the solution, rebuilding etc
Restarting the computer
Trying to launch another application. (Same result)
Created a new application from scratch. Same result.
Repairing Visual Studio Community 2017. Same result.
Stopping/Closing IIS Express
My setup was working perfectly yesterday and suddenly is not.
Thank you for your time. I hope we can find a solution.
We finally found the issue! After logging on to the machine as a different user, we saw a warning that the main user had ignored initially. There was a 0 byte file in the root of the directory named "Program" with no file extension. It appears that this causes some sort of issue when VSIISExeLauncher.exe is invoked through Visual Studio. (Note it would work if executed from the command prompt). After deleting the file, everything worked!
We do not know how this file was placed there for certain, but suspect it was some sort of copy error when the user was pulling in files from his old hard drive.
I don't know if anyone else will come across this, but if so hopefully this helps!
Maybe you need install previous versions of .NET Core, isn't it? I installed here and it works now. I had only .NET Core 2.0 installed and I realized that applications with 1.1 stopped so when running. In Windows' event logs I've had the same error registered.
Try to change the IISExpress to IIS by creating new IIS profile and change the Lunch to IIS. It resolved my problem.
I have hit a very similar issue with ASP.net Core 2.0. I had copied my VS project to a new one, and I was getting this error message.
After doing some research, I was able to determine that the nlog.config file was not copied into the bin > Debug > net461 folder. Once I did this, I was able to run my application.
I found it by running dotnet run from the command line on my project where the csproj files live.
Had same issue yesterday (windows 10).
Solved it this way:
Update Microsoft.AspNetCore to latest (Nuget manager - 2.1.3)
Make sure the sdk also updated to latest version. if not, update it manually from Nuget console like this:
Install-Package Microsoft.NETCore.App -Version 2.1.3
Download and install latest ASP.NET Core/.NET Core: Runtime & Hosting Bundle
from here
Same problem with version 2.2. Reinstalling .NET Core SDK fixed the problem for us.
In my case, my project was setup as a website in IIS and the file "bin\IISSupport\VSIISExeLauncher.exe" was missing in the project's directory.
I simply selected "IIS" when debugging the project in Visual Studio 2019 and it generated the missing file. It also generated 2 text files (IISExeLauncherArgs.txt, pidfile.txt) in the IISSupport folder, made changes to my web.config file, and my project ran successfully.
After that I was able to access the local website that was setup in IIS without running it in Visual Studio.

Visual Studio error "Object reference not set to an instance of an object" after install of ASP.NET and Web Tools 2015

After installing the ASP.NET and Web Tools 2015 (RC1 update 1) I get the following error within ASP.NET MVC 4 projects when opening *.cshtml files:
Object reference not set to instance of an object
I get the same error message even if I start a new ASP.NET MVC 4 project and try to open a *.cshtml file there.
I'm using Visual Studio 2015
Maybe this helps:
Delete the contents from the following folders:
C:\Users\%userprofile%\AppData\Local\Microsoft\VisualStudio
C:\Users\%userprofile%\AppData\Local\Microsoft\VSCommon
Sometimes, you need to go to:
[x64] C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
[x86] C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE
and run devenv /resetuserdata.
Expect, that all of your user settings such as Visual Studio layout, linked Microsoft account or start page might disappear.
Delete %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache and restart Visual Studio.
Alternatively, use the Clear MEF Component Cache extension.
For me,
I ended the process in Windows Task Manager: VsHub.exe.
Restarted Visual Studio.
After that, everything works like a charm again!
I solved it doing
run devenv /resetuserdata
in this path:
[x64] C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
I assume that in x86 it works in this path:
[x86] C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE
It's recommended to try any or all of the following:
Restart Visual Studio
Try Running As Administrator (right-click Visual Studio and choose "Run As Administrator")
Check for any updates for Visual Studio (download and install them if any are available)
Try opening a different solution / project
If problems persist, you might try the following options:
Restart your local machine
Attempt to reset Visual Studio to System Defaults (this can be done from the options within Visual Studio)
Attempt to repair your Visual Studio installation
In the hopes it might narrow things down/help someone, I did an investigatory approach. For me, I initially moved the folder at C:\Users\{user}\AppData\Local\Microsoft\VisualStudio to My Documents and allowed Visual Studio to re-create it by re-launching it. This removed the errors. So I moved everything back, one-by-one, and restarted Visual Studio each time until I discovered the culprits. These folders were fine to move back in:
1033 (overwrote the auto-generated copy with old)
Designer (was in my old copy, not initially re-created when I re-launched VS, copied it back in)
Extensions (overwrote the auto-generated copy with old)
ImageLibrary (overwrote the auto-generated copy with old)
Notifications (overwrote the auto-generated copy with old)
STemplate (was in my old copy, not initially re-created when I re-launched VS, copied it back in)
VTC (was in my old copy, not initially re-created when I re-launched VS, copied it back in)
These files were fine to move back in/overwrite the auto-generated ones:
ApplicationPrivateSettings (was in my old copy, not initially re-created when I re-launched VS)
ApplicationPrivateSettings.lock (overwrote the auto-generated copy with old)
vspdmc.lock (overwrote the auto-generated copy with old)
These files were fine to move back in. Each was in my old copy, and not initially re-created when I re-launched VS:
.NETFramework,Version=v4.0,Set=Framework,Hash=C958D412.dat
.NETFramework,Version=v4.0,Set=RecentAssemblies,Hash=0.dat
.NETFramework,Version=v4.5,Set=Extensions,Hash=75EAE334.dat
.NETFramework,Version=v4.5,Set=Extensions,Hash=497525A2.dat
.NETFramework,Version=v4.5,Set=Framework,Hash=5AE9A175.dat
.NETFramework,Version=v4.5.2,Set=Extensions,Hash=24CEEB0D.dat
.NETFramework,Version=v4.5.2,Set=Extensions,Hash=72AE305.dat
.NETFramework,Version=v4.5.2,Set=Extensions,Hash=ADF899D7.dat
.NETFramework,Version=v4.5.2,Set=Framework,Hash=D8E943A2.dat
These caused problems - delete these files and re-launch VS to allow it to re-create them:
ComponentModelCache - When I overwrote this folder's contents with my old ones (4 files: MS.VS.Default.cache, .catalogs, .err, .external), this gave me all of the errors I had gotten before about not being able to load packages when loading my project, and the "object reference not set to an instance of an object" error when trying to close VS.
devenv.exe.config - same as ComponentModelCache
.NETFramework,Version=v4.0,Set=Extensions,Hash=6D09DECC.dat - causes error output from the JavaScript Language Service, complaining of missing js files
.NETFramework,Version=v4.0,Set=Extensions,Hash=9951BC03.dat - causes error output from the JavaScript Language Service, complaining of missing js files
.NETFramework,Version=v4.5.2,Set=RecentAssemblies,Hash=0.dat - causes error output from the JavaScript Language Service, complaining of missing js files
These are the errors from those last .NETFramework files (which I do not get if I do not add them back in):
01:10:11.7550: Referenced file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\JavaScript\References\libhelp.js' not found.
01:10:11.7550: Referenced file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\JavaScript\References\sitetypesWeb.js' not found.
01:10:11.7550: Referenced file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\JavaScript\References\domWeb.js' not found.
01:10:11.7550: Referenced file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\JavaScript\References\underscorefilter.js' not found.
01:10:11.7550: Referenced file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\JavaScript\References\showPlainComments.js' not found.
I might just need to re-install/repair the JavaScript Language Service plug-in, so it might be un-related. But definitely devenv.exe.config and ComponentModelCache need to go to correct the "object reference not set to an instance of an object" error.
For me, ASP.NET 5 is not yet required, I removed update, and then reinstalled ASP.NET 4.5. It's a bit tricky:
Removed from control panel "Microsoft ASP.NET 5 RC1 Update1". After that, you will no longer open ASP.NET MVC projects
Then I changed the installation of "Microsoft Visual Studio Professional 2015", clicked "Modify", and selected "Microsoft Web Developer Tools"
No longer follow the notification of update in Visual Studio 2015!!!
After trying the top answer, I found that you must also restart the computer. The error may be part of a git issue as well where restarting your computer will reset.
I was getting an exception every time I tried to create a "new" project.
My solution was:
Go menu Tools → Extensions and Updates
Check the "Updates" link... There was an update to Microsoft ASP.NET and Web Tools. Install it.
That fixed it for me.
In my case (not necessarily be the solution for you, but it may be helpful for someone), the solution was:
Go menu Tools → Extensions and Updates
Select the Online tab from the right panel
Search for the words web tools, and then select Microsoft ASP.NET and Web Tools and install it.
In my case, this was missing from my computer because of a lot of repairing operations for Visual Studio.
I was getting similar error in VS2017 while trying to publish my solution to Azure.
This algorithm helped me to resolve it:
Close VS2017
Open C:\Users{your user name}\AppData\Local\Microsoft\VisualStudio\ folder
Rename 15.0_08edcd83 folder
Start VS
Publish works fine!
Note that this will remove your Visual Studio's recent files / projects from it's history and also linking to MS account.
This method is slightly different from the Top answer. Here you don't have to delete other folders except renaming abovementioned one.
I was getting this exception every time I created a "new" project.
My solution was:
Go menu Tools ? Extensions and Updates
Not check the "Updates" link...search "asp.net". There was an
update to Microsoft ASP.NET and Web Tools. Get it as
AspNetWebFrameworksTools2015_KB3137909.exe and install it.
That fixed it for me.
Unfortunately, I ran into another exception:
"Exception has been thrown by the target of an invocation"
I disabled the FIPS setting Enabled DWORD value to zero.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy]
Enabled=dword:00000000 And All fixed.
Goto windows+R and type %temp% and hit enter. delete the temp folder and files and then try opening the same
I have been fighting with this during the whole weekend. But it's pretty easy to do it. What I did was to click on repair rather than uninstall. After repairing, I clicked on restart directly. After that, everything is working perfectly.
You should try this, may be it can work also for you!!!
Restarting Visual Studio did it for me. On the next run, it displayed a "Scanning new and updated MEF components ..." and then it executed normally.
It seems to be related to Windows update somehow, although I don't have proof.
Delete bin and obj folders in all projects of that solution.
Seems like those folders were having old files generated by some older version of visual studio, which are not compatible with new version of visual studio.
The solution to the issue when i had this earlier today was that there was an additional
set of tags bolted on the end of my Web.config. Once removed the functionality returned.
Problem:
My VS 2015 was throwing up error after I installed SSDT. Whenever I clicked on Tools >> Extensions and Update it was throwing "Object reference not set to an instance of an object" error. When I tried to open a solution it threw some provider not set correctly.
Solution:
After many hours of research trying out all the solutions previously mentioned by others didn't solve my problem. Every time the error popup was pointing to check the ActivityLog.xml. But I was ignoring it. After hours of frustration I decided to read the error carefully and looked into ActivitLog.xml and found that it was looking for "Could not load file or assembly 'System.Collections.Immutable, Version=1.1.37.0". So I just started searching for this assembly and stumbled upon this link https://sergeytihon.com/2015/12/01/how-to-restore-viual-studio-2015-after-update-1-dependency-dance/
and followed the steps there, which fixed my issue.
Went into %LOCALAPPDATA%/Local\Microsoft\VisualStudio\14.0\devenv.exe.config and searched for "System.Collections.Immutable" and change newVersion from 1.1.36.0 to 1.1.37.0
Final config should look like this
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="1.0.27.0-1.1.65535.65535" newVersion="1.1.37.0"/>
</dependentAssembly>

Debugger For Visual Studio is not Working

I am facing a very serious issue with visual studio debugger. My asp.net application is hosted on local IIS server. Yesterday i was debugging my code suddenly it stopped working. I verified w3wp process. It was same as IIS process. Then i tried to download symbols but i am not sure either they are all that i need. I tried attaching debugger on visual studio 10 and visual studio 12. Neither of them is working in this case. I tried to attach debugger of JavaScript but it is also not working.
Please Help.
Are you building full debugging symbols? If not then the debugger has no information to relate the source code to the in memory activity under the debugger. This is set in the project properties per configuration.
Also ensure the symbols are in the bin folder.
You can validate that VS is loading the right symbols with the Debug | Modules window.
I cleared temporary cache of .NET Framework. then i again deployed my application on IIS with different name and magically everything started working.

Which, if any, recent Windows updates should I uninstall to revivify Silverlight or rectify other problems?

All of a sudden, a large asp.net project stopped working, without any code changes relevant to the problem. As we are using Visual Studio 2010 here at work, I uninstalled the Update for Visual Studio 2012 (KB2781514), which perhaps had been installed because I installed a version of Visual Web Developer Express. Anyway, whether or not uninstalling that update fixed the problem, I don't know, because it is perhaps prior to the spot where a permissions/authentication error was occurring in the project that I now see this in our Silverlight report viewer page:
As the code had not changed from "working fine" to "no longer working" (the exact same code works on another machine, one that is not shut down each night and thus does not have all the updates that I have on my machine), we determined it was perhaps some updates to the computer that were gumming up the works.
In Windows 7, I can see installed updates via All Programs | Windows Updates | View Update History | Installed Updates, and found these updates in the window (no pun intended) between when the project was last observed working and when it busted down around O'Connally Corners (gratuitous Doobies reference):
6/18:
.NET Framework 4 Multi-Targeting Pack (1):
KB2504637
6/19:
Windows Management Framework 3.0:
KB2506143
Update for Visual Studio:
KB2781514 - uninstalled 6/21, but still get Silverlight err msg (see SilverlightErrMsg.png)
6/20:
Update for Windows:
KB2823180
KB2809215
KB2809900
Security Update for .NET Framework 4.5:
KB2737083
KB2742613
Update for MS .NET Framework 4.5:
KB2750147
KB2805221
KB2805226
I don't want to go on a "wild goose chase" uninstalling everything an update at a time, rebooting, retesting, etc. (if I can help it).
Is anybody aware of any of these updates causing a problem, or have an educated intuition on which one[s] could be the culprit[s]?
UPDATE
I reinstalled the Silverlight SDK, and it moved the error from one place to another, and to a different error. Now it's:
System.IO.FileLoadException was unhandled by user code
HResult=-2147286790
Message=Could not load file or assembly 'TLDCommonLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4ced62d0f7a74a89' or one of its dependencies. An API call exited abnormally. (Exception from HRESULT: 0x800300FA (STG_E_ABNORMALAPIEXIT))
Source=PollerDataImportServiceLib
FileName=TLDCommonLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4ced62d0f7a74a89
FusionLog==== Pre-bind state information ===
LOG: User = CCR\u9867duckbilledPlatypus
I have had similar problems in the past with updates to Windows and / or VS breaking the Silverlight SDK.
Usually, reinstalling the Silverlight SDK will resolve this. Sometimes I have had to reinstall Silverlight and the SDK.
This answer on SO has a similar issue regarding that new exception you are seeing. The answer revolves around correcting user permissions.

Visual Studio 2003 - opening ASP.NET project - getting "The operation timed out" error message

Occasionally, when I open a visual studio 2003 ASP.NET project it seems to spend forever loading up then finally displays the following error message:
"The web server reported the following error while attempting to create or
open the web project located at the following URL:
http://localhost/myprojectname. The operation timed out."
Any idea why this happens and how to fix it?
The fix for me was to unregister the re-register iis for .net:
Open command window and navigate to C:\windows\microsoft.net\framework\v1.1.4322
Type in aspnet_regiis -u
Once finished uninstalling ASP.NET type in apsnet_regiis -i
Just performing aspnet_regiis -i by itself did not work.
Still unsure as to why this is happening but probably something to do with switching dev environments between Eclipse\Java\JBoss to VS2003\C#\IIS
This worked for me...
http://forums.asp.net/p/1192304/2066860.aspx
On my XP development machine I went to "C:\Documents and Settings\USERNAME\VSWebCache\USERNAME\" and deleted the folder matching my VS2003 solution name. (Actually I moved the folder to C:\Temp just in case). This worked, although one designer file would not load without a re-build and the start-up page needed to be re-marked. I don't understand why my solution depends on this VSWebCache (it re-appeared when I re-built my solution.) Can anyone explain this dependence? It's un-settling.
This Worked for me. Hopefully it will work for you people also.
Initially, I had tried these many things :
Open command window and navigate to C:\windows\microsoft.net\framework \v1.1.4322 Type in aspnet_regiis -u Once finished uninstalling ASP.NET type in aspnet_regiis -i (It was working sometimes but not always).
I tried by Clearing the vswebcache of Visual studio 2003, as per some forum answer, but didn't work out.
Then finally, I used my own technique and it worked for me. I took the old dll's for the project which was not getting load and i had replaced the dll's with old project dll's. After that my project got load into visual studio 2003. There will be one dll and pnb file with name of project which will get corrupted sometime and your project wont get load into IDE.
So, if you face similar issue, then you have two options:
1) Replace the Dll's with old dll's.
2) Delete the Dll and pnb file with project name and try to reload it again.(Deleting the dll is not going to affect your code and other dll's).
Hopefully it will work for you too :)

Resources