I recently went through the event log on one of my dev servers running 2008 R2 and realized that the Application Server has been quite active in logging errors about not being able to start the following services.
The errors were along the lines of what’s shown below.
Error: Installation of [Application Server] TCP Port Sharing failed. Attempt to install TCP Port Sharing failed with error code 0x80070002. The system cannot find the file specified
It turns out that when I updated .Net Framework 4.0 to the latest version, windows did not automatically change the location of the service libraries to reflect the updated version.
To fix this, open the the registry (regedit) and go the following location.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
Select the Services listed above and make a not of the file path for the Description, DisplayName and ImagePath keys.
Now open up windows explorer and navigate to,
C:\Windows\Microsoft.NET\Framework64\
and copy the latest version number of the .Net framework (mine was v4.0.30128). Change the version number in the registry keys to match this number and try starting the services manually.
That’s it! The next time you restart the server, your Application Server should be running without any errors!