Unable to run post Installation task for wsus

lalajee 1,821 Reputation points
2023-05-19T14:58:51.5466667+00:00

Hi,

I have Server 2019 Std

SQL 2019 STD with CU 20

When I run Post installation task for WSUS its keep failing with below error

2023-05-19 15:42:43  Postinstall started
2023-05-19 15:42:43  Detected role services: Database, UI, Services
2023-05-19 15:42:43  Start: LoadSettingsFromXml
2023-05-19 15:42:43  Start: GetConfigValue with filename=UpdateServices-Services.xml item=ContentLocal
2023-05-19 15:42:43  System.TypeInitializationException: The type initializer for 'Microsoft.UpdateServices.Internal.UtilConstants' threw an exception. ---> System.IO.InvalidDataException: Invalid installation directory
   at Microsoft.UpdateServices.Internal.SetupInfo.GetInstallDirectory()
   at Microsoft.UpdateServices.Internal.UtilConstants..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.UpdateServices.Administration.PostInstall.GetConfigValue(String filename, String item)
   at Microsoft.UpdateServices.Administration.PostInstall.LoadSettingsFromXml()
   at Microsoft.UpdateServices.Administration.PostInstall.Execute(String[] arguments)
Microsoft Security | Intune | Configuration Manager | Updates
Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. AllenLiu-MSFT 49,316 Reputation points Microsoft External Staff
    2023-05-22T02:50:19.7+00:00

    Hi, @lalajee

    Thank you for posting in Microsoft Q&A forum.

    2023-05-19 15:42:43 Start: GetConfigValue with filename=UpdateServices-Services.xml item=ContentLocal

    Please try renaming file name UpdateServices-Services.xml to updateservices-services.xml.old. Then run post-install again.

    (UpdateServices-Services.xml is under c:\windows\system32\servermanager\componentconfiguration)

    If issue persists, please try to remove wsus role , wid, delete database file, reinstall wsus again.

    https://www.ajtek.ca/wsus/how-to-remove-wsus-completely-and-reinstall-it/


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".


1 additional answer

Sort by: Most helpful
  1. Williams, Ian (IT Services) 0 Reputation points
    2025-06-16T11:26:50.0133333+00:00

    Struggled with this myself for quite a while. Logon as the default local administrator account. Delete your content directory if it already exists (i.e. D:\WSUSContent). Recreate the directory while logged in as the local administrator and then try again

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.