Windows Process Activation Service Error 2:The system cannot find the file specified - asp.net

IIS on my development computer stopped working. I just installed the latest update to windows 10 (1803) and now when I try to start the "Windows Process Activation Service" I get an "Windows could not start the Windows Process Activation Service on Local computer. Error 2: The System cannot find the file specified" error. Things I have already tried:
Reinstalled IIS and Windows Process Activation Service, several times
I verified that I do have a "C:\inetpub\temp\appPools" folder
Not sure what to do next.

I have had this problem twice after a windows update. The issue seems to be, that windows adds an incorrect parameter to the WAS service startup parameters. I fixed the issue using the following steps:
Start regedit (just type it into start)
Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WAS\Parameters
Delete the NanoSetup variable. This variable is preventing WAS from starting
Start the WAS service using task manager or by typing "net start WAS" in Command Prompt
Start the W3SVC service the same way
You can now start your website in IIS again

I had the same problem and nothing in here was the solution for me for a long time. So i rolled back windows also. Today i found the solution working for me - Navigate to:
C:\Users\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys\
find these 3 Key-files...
d6d986f09a1ee04e24c949879fdb506c_*
76944fb33636aeddb9590521c2e8815a_*
6de9cb26d2b98c01ec4e9e8b34824aa2_*
... then in Security-Settings:
first, you have to set your User as OWNER
close Properties Dialog - and open again
Then in ACL set "full controll" for SYSTEM
After that: WPA can be started...
Hope this helps; see also thread here: https://social.technet.microsoft.com/Forums/en-US/315841e1-b8b2-4084-8224-580ef3d13420/upgrade-to-windows-10-1709-iis-fails?forum=win10itprosetup

I had this same problem after installing the Windows 10 1909 update and the nanosetup variable was NOT in the registry. I ended up doing a variation of Sascha's fix.
I took ownership and gave administrators full control of the MachineKeys folder in C:\ProgramData\Microsoft\Crypto\RSA. Then I removed the 3 files in Machinekeys that begin with:
d6d986f09a1ee04e24c949879fdb506c_*
76944fb33636aeddb9590521c2e8815a_*
6de9cb26d2b98c01ec4e9e8b34824aa2_*
The Windows Process Activation Service (WAS) started as expected.

It just has a simple solution, you don't need to reinstall Windows or removing updates, It worked for me so sharing it with all of you,
if you already using IIS and have site's configurations and files in C:\windows\system32\inetsrv\config and C:\inetpub\wwwroot, Back up all files from the folder C:\windows\system32\inetsrv\config and C:\inetpub\wwwroot, if you are installing ISS for the first time then you don't need to have a back up.
On Taskbar right-click on Start button select 'Run', type appwiz.cpl hit Enter.Click on 'Turn Windows features on or off'.
Uncheck 'Internet Information Services' and 'Windows Process Activation Service' click OK button.
After restarting Windows, Delete 'inetpub' folder on C: drive.
Open 'Turn Windows features on or off window' again.
Check 'Internet Information Services' and 'Windows Process Activation Service' click OK button.
After restarting Windows open folder C:\windows\system32\inetsrv\config.
Right click on the file named 'applicationHost' Select Open with Notepad.
In Notepad, Copy all the content of the file.
Select New in File Menu and Paste all the content in the new file.
Save this file in C:\windows\system32\inetsrv\config with the name 'applicationHost.config.tmp', Don't forget choosing 'All Files' in the 'Save as type' box.
Otherwise, file will be saved as applicationHost.config.tmp.txt which will not work.
Type 'Services.msc' in Run, Find 'Windows Process Activation Service' in Services window.
Watch running the service successfully without any errors after clicking on start.

I finally had to give up and rollback the windows build. To do this follow these steps:
Go to settings (Windows+I)
Click on "Update & Security"
On the left click on "Recovery"
Then under "Go back to the previous version of Windows 10" click "Get
started"
It rolled back to "1709" and now works fine.

If you find yourself installing an application on a drive other than C: and that application relies on IIS, the path for inetpub temporary files may be missing. Even if they are present on C:, this may just confuse you into thinking they are present and thus not the issue.
Create the following empty directory structure, replacing G: with the drive letter that your application is installed to, other than C:.
G:\inetpub\temp\apppools
Then, start WAS, from an administrator command prompt:
net start WAS
If this has to do with IIS, restart for good measure, from the same prompt:
IISRESET /restart
This solved my problem when installing a third party application.

I received the same error after update, but on Windows Server 2022 Standard 21h2.
Tried all steps without success.
In my case WU deleted all params in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WAS\Parameters
so i took it from old ControlSet002:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WAS\Parameters]
"AccessDeniedMessage"="Error: Access is Denied."
"InstallPath"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,\
00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,69,00,6e,00,65,00,74,00,\
73,00,72,00,76,00,00,00
"MajorVersion"=dword:0000000a
"MinorVersion"=dword:00000000
"ServiceDll"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,\
00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,69,00,6e,00,65,00,74,00,\
73,00,72,00,76,00,5c,00,69,00,69,00,73,00,77,00,33,00,61,00,64,00,6d,00,2e,\
00,64,00,6c,00,6c,00,00,00
"GenerateKeys"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WAS\Parameters\ListenerAdapters]

Related

Startup Project keeps reverting to IIS Express for debugging

In my solution I basically have two projects, the one I'm coding on, and the startup project, Startup.csproj. I have Startup.csproj configured to use Local IIS for debugging, and I normally just attach to the worker process to debug.
However, at random intervals, the Startup.csproj defaults back to IIS Express for debugging. It does not show as a change in the Startup.csproj project file, and sometimes even still shows Local IIS but fails with a "Cannot list contents of directory" error.
I'm running VS 2017 v15.9.15. What could be causing this annoying little phenomenon?
I thought I am going crazy. I found the settings driving that behavior in the project file. I set the UseIISExpress to 'false' and the other one all the way at the end of the file project UseIIS to 'true' and when reloading still set to use IISExpress.
Turns out there's a <ProjectFile>.csproj.user that will overwrite default settings. Search for the UseIISExpress in this file and set it to false and Voila! problem solved.
Restart your IIS and try as above
and go to the root directory and delete .vs directory if exists.
or
In the Processes window (Debug -> Windows -> Processes), right-click on the name of the process you want to detach, and on the shortcut menu, click Detach Process.:
Another scenario may be that the port that IIS is using for your application is already being used by another running application. Try changing the port and see if it works for you.

IIS 10.0 AppPool crashing (causing 503 error)

Situation
After the latest Windows 10 updates (Nov 2017) were installed, the Application Pool required by a local web application keeps stopping/crashing displaying the message below in Event Viewer:
The worker process for application pool 'SrvAppPoolv4.0'
encountered an error 'Cannot read configuration file ' trying to read
configuration data from file '\\?\<EMPTY>', line number '0'. The data
field contains the error code.
Setup
Windows 10
Internet Information Services (Version 10.0.16299.15)
What I've tried
I've tried a few things that I've found via Google, both here on Stackoverflow and other sites, nothing has helped so far. Some of what I've tried:
Changed the AppPool Identity to a different user (Right-click, Advanced Settings).
Checked the permissions on the machine.config (all four of them in the various \Windows\Microsoft.NET\Framework\.. and ..\Framework64\.. folders).
Unchecked the IIS and .NET features (Control Panel / Windows Features) and then added them back in again.
Uninstalled the application in question, cleared everything, then re-installed it.
Nothing has helped.
Besides reinstalling the entire machine, what else can I try?
Also, besides the Event Viewer, are there any other logs I can review to get more details? I read something about an application log, but nothing as to where to find it?
Update:
I just tried what user3739842 suggested Add/Remove Programs, selecting IIS Express and then Repair - issue remains.
Solution
For me the solution was the following (thanks rusware):
Go to the drive your IIS is installed on, eg. C:\inetpub\temp\appPools\
Delete the directory (or virtual directory) with the same name as your app pool.
Recycle/Start your app pool again.
In my case, it was a virtual directory which was corrupted.
Hi the answer to your problem can be found here. It worked for me and same error
Cannot read configuration file ' trying to read configuration data from file '\\?\<EMPTY>', line number '0'.

Windows Explorer not refreshing after CreateFolder (new folder)

We have built a WebDav Service with your Engine and have a one problem when we create a new Folder or File:
The new folder / file is created successfully, but not showing in the Windows Explorer. Only if you press F5, the new folder / file is showing (and the name is already selected to be edited).
This behavior is reproducible even with a blank WebDav Solution.
We can reproduce this on Windows 7 and Windows 8 (8.1) using WebDav .NET Server 3.8 and the latest 3.9.
Is there a way to get around this “refresh-problem”?
I solved this issue but clicking in the folder explorer at view > options > then i restored to default and everything is back to normal.
I assume this issue is in Windows Explorer on a single computer. Most likely the WebDAV server-side code is failing with with some exception. Here are some ideas how to detect what is wrong:
Unmount network connections executing 'net use * /DELETE' in a command prompt, this will unmount WebDAV connections too and simulate 'clean' environment.
Retry reproducing the issue and examine your WebDAV logfile. By default it is located in /App_Data/WebDAV/Logs/ folder. Are there any exceptions in it?
Use Fiddler tool or any other debugging proxy to capture and examine HTTP requests. Are there any failed requests?
In case you are creating a folder/file on one computer using Windows Explorer (Microsoft Mini-redirector driver) or IT Hit Ajax File Browser and expect the files list to refresh automatically on another computer this would not work. Mini-redirector does not support any notifications from server and WebDAV does not submit any notifications, you need to refresh the files list manually to see the new items created.
I found this video on Youtube that explains in very much detail how to fix this problem: https://www.youtube.com/watch?v=UUiCPsQquqc
It is a bit lengthy, so I'll just quickly sum it up here:
The reason for these problems are one or more (broken) Shell Extensions that prevent the refresh of the Windows Explorer
To fix it, open up regedit.exe (requires admin privileges), do a search for the Registry Key "DontRefresh". If it is "1", set it to "0". There might be multiple matches for that Key, so repeat until all Keys have the value "0".
This might not work immediately, you may have to kill and restart your explorer.exe process (easiest to do with the Task Manager). Or you can simply reboot your computer. In my case, it worked immediately.
According to the video, the Keys should only be located under HKEY_CLASSES_ROOT/CLSID, but in my case I could only find such Keys in HKEY_LOCAL_MACHINE/Classes/Wow6432Node/CLSID.
I figured it makes most sense to simply search the complete Registry, it does not take very long.
I tred a lot of hacks, from scanning the system, to recreating the profile to hacking Registry keys and hives.
Finally what worked for me -
Right click on desktop
Select Personalize
Click Themes
Click Change desktop icons
Click Restore default & OK
And instantly it began to auto refresh with a new folder, rename, delete, copy, etc.

Cannot delete file in network share

The summarized problem is that I cannot delete specific files in a network share. The files seem to be locked on the server side and not by a windows service. The computers where this problem originated was under a domain and the documents and other windows libraries are on a network share. I have tried several solutions that will be described below.
Here is what happened:
While debugging a web application in Visual Studio, I got the infamous blue screen of death. After I restarted and wanted to resume debugging, the project did not compile. I got this error: "Unexpected error creating debug information file z:\MY_Proj_Dir\obj\Debug\My_Proj_Name.pdb Access is denied". Which I found weird, since I have debugged that project in that location many times before. The unexpected windows error while running the debug session in Visual Studio must have locked it somehow. This file is for debugging information and after looking in forums how to resolve the issue, they recommended to delete the Debug directory.
So here are the solutions I have tried:
- First, of course, I tried to clean and rebuild the project.
- Close visual studio and restart the computer and tried again.
- try to manually delete the obj\Debug directory: The files My_Proj_Name.dll and .pdb could not be deleted because apparently I need permission to perform this action from the administrator, which is myself.
- So I right click the directory, open properties -> Security -> Advanced-> ownership -> and the ownership is of my_user_name#the_domain. Which is the account I am logged in from. If I try to change ownership to the only option that gives me there, which is the same (my_user_name#the_domain) , ticking replace owner on subcontainers and objects, it gives me an error “Error applying Security: access denied”. The same if I try to do it on the individual .dll and .pdb files.
I have tried turning User Account Control off, restarting and trying to delete the file.
I have also tried using the command line with no luck.
I tried the tool "unlocker" to see if I can release the file from other windows services or write permissions, but I still cannot delete them.
To see if the problem was on the computer, I tried to log in using VPN from my home computer and accessing the network drive:
- If I delete the files from there, they immediately reappear, without any "cannot delete" dialog. It doesn’t let me change ownership of those files either.
I started up my Ubuntu VM and accessed the network share. and tried to delete the files from there. It gives me an even more weird error message: "File does not exist". But I can see it there!
I tried to log in to the network share from WinSCP and putty, but I cannot access the domain DNS with ssh or ftp. Probably the server only supports SMB (windows share)... I am not sure.
note: I only have problems with that specific folder and its files. I have no problems with any other folders in my network drive. One thing I have learned is not to debug projects located on a network share.
The problem was solved by working offline and debugging locally. Working offline Visual studio was able to rewrite the debug information files. From visual studio I clean the solution and the files were deleted. It seems that released the lock visual studio had on those files. Once it was working offline it was just a matter of turning the work online mode again. Then I was able to compile and debug normally.
I learned not to debug directly on the network share, but instead have my visual studio projects locally to avoid ownership and permission problems.

Can't attach to w3wp under Vista with UAC turned on

I run Vista (business x32) on my work machine, in which I do ASP.NET development. Because I use IIS to server the sites I build (I do a lot of CMS integrations so I need to use IIS not the inbuilt web development server) I always need to attach to w3wp for debugging.
The problem is that w3wp requires elevated permissions for me to connect to the processes from VS 2008. But when I try and restart VS to "run as administrator" I get the error:
"This program has been blocked"
"Your administrator has set a policy to block this program"
I only get this problem when I'm logged into my machine with my domain account (which is in the local admin group), if I use the local admin I have no problems.
I'm the only person on the domain who has this problem, everyone else using Vista can open VS as an administrator no dramas.
To get around this I have to turn off UAC, but it always turns itself back on (after each restart), so this is highly frustrating.
I've not been able to find out how to add a program to the "safe" list either.
Have you asked the Domain Admins if they have a Group Policy which is re-enabling UAC?
It may be that Vista by default has only a few places that can run unrestricted and if you have Visual Studio installed outside those areas, it may be preventing it from running with elevated permissions.
Check where it is installed, and add its location as an "unrestricted" area within the Softwware Restrictions / Additional Rules area.
To do this follow these steps:
Open the secpol.msc editor.
Browse to Local Policies / Software Restriction Policies / Additional Rules.
Then right click the right window and choose New Path Rule...
Browse to the path where VS is installed and set the Security Level to Unrestricted.
See if that doesn't do the trick.
Good Luck!
You could write a script that disables UAC and then run that script every time you restart your computer, or maybe just before you launch VS.
Modify registry:
How to Disable or Enable Vista User Access Control in Command Prompt
More options for disable/enable UAC:
How to Disable and Turn Off UAC in Windows 7
I can open VS with "Run as administrator" under my domain account (which is in the local admin group) on my work computer, so I suspect something is wrong on your computer. And by now, you may have had you PC re-imaged, so perhaps the problem went away for you.

Resources