You have a COM+ server application in which the identity is configured to run as a specific user. After working for some time, the application may stop working and keep failing. You have to restart the COM+ application to resolve the issue. In today’s post, we will identify the cause and then provide the resolution to the issue of a COM+ application may stop working in Windows 11/10 when a user logs off.
A COM+ application is the primary unit of administration and security for Component Services and consists of a group of COM components that generally perform related functions.
By creating logical groups of COM components as COM+ applications, you can take advantage of the following benefits of COM+:
- A deployment scope for COM components.
- A common configuration scope for COM components, including security boundaries and queuing.
- Storage of component attributes not provided by the component developer (for example, transactions and synchronization).
- Component dynamic-link libraries (DLLs) loaded into processes (DLLHost.exe) on demand.
- Managed server processes to host components.
- Creation and management of threads used by components.
- Access to the context object for resource dispensers, allowing acquired resources to be automatically associated with the context.
Event ID 10006 & 1530, COM+ application not working
When a COM+ application stops working in Windows when a user logs off, you may see an error that resembles the following in the Application log on the client machine. If the client executable runs on the same computer as the COM+ server application, you will see this error on the COM+ server:
Event Type: Error
Event Source: DCOM
Event Category: None
Event ID: 10006
Date: 10/17/2009
Time: 1:36:39 PM
User: Domain\user
Computer: *****
Description:
DCOM got error “Unspecified error ” from the computer ‘servername’ when attempting to activate the server: {AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}
You’ll also see events that resemble the following in the Application log of the computer on which the COM+ application runs:
Log Name: Application
Source: Microsoft-Windows-User Profiles Service
Date: 10/26/2009 8:22:13 AM
Event ID: 1530
Task Category: None
Level: Warning
Keywords: Classic
User: SYSTEM
Computer: SERVERNAME
Description:
Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards.DETAIL –
1 user registry handles leaked from \Registry\User\S-1-5-21-1049297961-3057247634-349289542-1004_Classes:
Process 2428 (\Device\HarddiskVolume1\Windows\System32\dllhost.exe) has opened key \REGISTRY\ USER \ S-1-5-21-1123456789-3057247634-349289542-1004_CLASSES
What causes Event ID 10006 and 1530
According to Microsoft;
The User Profile Service will force the unloading of a user profile when that user logs off. This is a situation where the functionality of forcing the unload of the user profile may break an application if registry handles are not closed in the process. This new User Profile Service functionality is the default behavior.
The user identity that is associated with the COM+ application is logged on when the COM+ application is first initialized. So, this issue is triggered if this user were to log off of the machine then the user’s profile would get unloaded and the COM+ application can no longer read registry keys in the profile of the user identity.
To resolve this issue, you’ll need to modify the default behavior of the User Profile Service via Group Policy Editor (gpedit.msc).
Here’s how:
- Launch Local Group Policy Editor.
- Navigate to the following path:
Computer Configuration > Administrative Templates > System > User Profiles
- On the right pane, double-click the Do not forcefully unload the user registry at user logoff entry to edit it’s properties.
- Now change the setting from Not Configured to Enabled by selecting the corresponding radio button which disables the new User Profile Service feature.
- Click Apply > OK.
The policy-setting ‘Do not forcefully unload the user registry at user logoff‘ counters the default behavior of the Windows client operating system. When enabled, the User Profile Service will not forcefully unload the registry, instead, it waits until no other processes are using the user registry before it unloads it.
Hope this helps!