Why does the Application event log show a .NET Runtime error 1022 every time ProfileUnity runs, and is something wrong with the client?
On endpoints running ProfileUnity Client 6.8.0 and later, Windows logs a .NET Runtime event 1022 at level Error, reading "There was a failure initializing profiling API attach infrastructure", each time a ProfileUnity .NET process starts elevated. The event is expected and safe to ignore. It is a side effect of the protection ProfileUnity applies to its elevated processes, and the client works normally. This article explains what the event means, how to confirm it comes from ProfileUnity, and how to keep it out of your troubleshooting view.
Status
| Issue Status | BY DESIGN |
| Affected Versions | ProfileUnity Client 6.8.0 and later |
| Fix Version | None. The event is a side effect of a security protection and is expected. |
| Workaround Available | None needed. The event can be filtered out of Event Viewer views; see Filtering the Event › |
Symptoms
The Application log contains Error events from source .NET Runtime, event ID 1022, with text like the following. The process ID changes with each event.
.NET Runtime version 4.0.30319.0 - There was a failure initializing profiling API attach infrastructure. This process will not allow a profiler to attach. HRESULT: 0x80004005. Process ID (decimal): 3932. Message ID: [0x2509].
- One event is logged for each ProfileUnity .NET process that starts elevated, so several can appear at every logon, logoff and postflight run.
- The events appear on every endpoint running the client, every day, including on endpoints where ProfileUnity is working correctly.
- No event is logged when no elevated ProfileUnity process starts.
Cause
When ProfileUnity needs administrator rights, its elevation service starts the client process with an elevated token. To stop other processes in the user's session from opening that elevated process and taking its administrator token, ProfileUnity locks the process down: the user's own account is denied permission to query it.
Every .NET Framework process, as it starts, prepares the ability for a diagnostic profiler to attach to it later. Part of that preparation is querying its own process to read its user account. Inside a locked-down ProfileUnity process, that query is denied, so the .NET runtime skips the preparation and logs event 1022. No profiler is involved, and nothing is attached or removed.
How to Confirm
Other software can log the same event, so confirm that the events you are looking at belong to ProfileUnity before setting them aside.
Check 1 — List the events
In PowerShell on the endpoint, list the 1022 events with their times and process IDs:
Get-WinEvent -FilterHashtable @{LogName='Application'; ProviderName='.NET Runtime'; Id=1022} | Select-Object TimeCreated, Message
Note the Process ID (decimal) value and time of the events you want to check.
Check 2 — Match the process ID to a ProfileUnity elevation
In the lwl_userapp_trigger log from the same session (included in a ProfileUnity client diagnostic bundle), search for the line that records each elevated launch:
Waiting for elevated PID:
If the PID on that line matches the event's process ID at the same time, the event came from an elevated ProfileUnity process and is the expected behavior described here. If it matches no ProfileUnity process, investigate the event as you would for any other application.
Filtering the Event
No action is required. If the events get in the way during troubleshooting, create a custom view that hides them. This changes what the view shows; the events are still written to the log.
Step 1 — Open the custom view editor
In Event Viewer, go to Action › Create Custom View and select the XML tab. Select Edit query manually and confirm the prompt.
Step 2 — Replace the query
Replace the contents of the box with the following query, then select OK and name the view:
<QueryList>
<Query Id="0" Path="Application">
<Select Path="Application">*</Select>
<Suppress Path="Application">*[System[Provider[@Name='.NET Runtime'] and (EventID=1022)]]</Suppress>
</Query>
</QueryList>
The new view shows the full Application log without the .NET Runtime 1022 events.
FAQ
Does this event mean .NET Framework is damaged and needs a repair?
No. The event is caused by the protection on the ProfileUnity process, not by the .NET Framework installation. Repairing or reinstalling .NET Framework does not change it.
Is there a setting that stops the event from being logged?
No. .NET Framework has no supported setting that turns off profiler-attach preparation. Do not change .NET runtime environment variables or registry values to try to suppress it; doing so can affect every .NET application on the endpoint.
Why not remove the protection that causes it?
The protection stops other processes in the user's session from taking the administrator token of an elevated ProfileUnity process. Permissions loose enough for the .NET runtime to query the process would also weaken that protection, so the protection stays and the event is expected.
| Product | ProfileUnity |
| Applies To | ProfileUnity Client 6.8.0 and later |
| Updated | October 30, 2026 |