Why does a .NET application delivered with FlexApp take minutes to start, while an antivirus exclusion on its folder makes no difference?
This article covers a slow first start of .NET Framework applications on machines protected by Microsoft Defender Antivirus. The delay is not caused by FlexApp. It comes from Defender cloud checks on the application's .NET assemblies, which Defender receives through AMSI (Antimalware Scan Interface). The article explains how to confirm the cause with Defender's own performance recorder, and how to resolve it with a process exclusion.
For the standard antivirus exclusions for ProfileUnity and FlexApp, see Antivirus Exclusion List for ProfileUnity Program Files and Directories. Those exclusions are still required; this article adds one application-specific exclusion on top.
📄 Contents
Symptom
A .NET Framework application delivered as a FlexApp package shows some or all of the following:
- The first start takes one to three minutes, while a start with Defender cloud protection off takes seconds.
- A second start straight after the first one is fast.
- After a reboot or a non-persistent desktop refresh, the start is slow again. Sometimes it is fast, with the same settings.
- Process Monitor shows the application pausing for about 10 seconds at a time while it loads its own
.dllassemblies. During each pause,MsMpEng.exehas an open HTTPS connection to a Microsoft cloud address that answers after exactly 10 seconds. - Turning off Cloud-delivered protection (MAPS) or Block at First Sight makes the start fast.
- Path exclusions on the application folder, or on the FlexApp mount folder, do not help.
FlexApp layering itself is not slow in this situation: the package mounts and activates in a few seconds. The time is lost after the application starts.
Cause
When a .NET Framework application loads its assemblies, the .NET runtime passes them to Defender in memory through AMSI. Defender scans that content inside the application process, and the application waits for each scan to finish.
If the content matches a Defender low-fidelity signature, Defender does not decide locally. It asks the cloud for a verdict. With Block at First Sight on, Defender holds the content until the cloud answers, for up to 10 seconds per request. For assemblies the cloud rarely sees, for example a vertical-market application or files signed with a code-signing certificate that has since expired, the cloud uses that full time. One scan can trigger two or three requests, which gives pauses of 20 or 30 seconds.
An application that loads 15 to 20 of its own assemblies at startup can lose one to two minutes this way. Whether a start is slow or fast depends on what Defender and the cloud remember, which explains the random pattern after a desktop refresh.
The same behavior applies to a locally installed copy of the application. FlexApp only makes it more visible, because the files are new to every non-persistent desktop.
Confirm the cause
Use the Defender performance recorder. It is built into Microsoft Defender Antivirus (platform 4.18.2108 or later) and changes no settings. Run the commands in an elevated PowerShell.
1. Prepare a clean start
Log the user on, but do not start the application yet. Close Process Monitor if it is running, because it distorts the timings.
2. Start the recording
New-MpPerformanceRecording -RecordTo C:\Temp\appstart.etl3. Start the application
Start the application as the user. Once it is fully open, press Enter in the PowerShell window to stop the recording.
4. List the AMSI scans
This lists every AMSI scan in start order, with its duration in seconds:
$r = Get-MpPerformanceReport -Path C:\Temp\appstart.etl -TopScans 10000 -Raw
$r.TopScans | Where-Object Reason -eq 'AMSI' | Sort-Object StartTime |
Select-Object @{n='Seconds';e={[math]::Round($_.Duration/1e7,1)}}, ProcessPath, PathThe cause is confirmed when you see:
- a series of scans with
ProcessPathDotNetand aPathlikeMemScanVfz-AMSI-<GUID>; - several of those taking about 10, 20 or 30 seconds;
- the scans of the application's files on disk taking well under a second each.
5. Note the signature that triggers the cloud check
Keep this output for the report to Microsoft in the resolution below:
$r.TopScans | Where-Object Reason -eq 'AMSI' | ForEach-Object Comments |
Select-String 'Low-fidelity detection, (sigseq=\w+, sigsha=\w+)' |
ForEach-Object { $_.Matches[0].Groups[1].Value } | Group-Object | Select-Object Count, NameDefender's own log, C:\ProgramData\Microsoft\Windows Defender\Support\MPLog-*.log, may also show a line with Engine VFZ lofi/sample/expensive for one of the application's assemblies. MPLog timestamps are in UTC.
Resolution
A process exclusion means Defender no longer scans the files that process opens, including the content it passes through AMSI. Use it only for the application's main executable, and do not turn off cloud protection or Block at First Sight to work around this issue.
1. Test a process exclusion on a test machine
Add a temporary exclusion for the application's main executable, then repeat the recording from Confirm the cause. Replace app.exe with the real file name.
Add-MpPreference -ExclusionProcess 'app.exe'Local exclusions only take effect when DisableLocalAdminMerge is not set by Group Policy, Configuration Manager or Intune. On a machine where it is set, test through the policy instead.
With a working exclusion, the recording shows hardly any AMSI scans from DotNet, and the start time drops back to seconds. Remove the test exclusion afterwards:
Remove-MpPreference -ExclusionProcess 'app.exe'2. Check for child processes
A process exclusion does not cover processes that the application starts. Open the parts of the application users work with, then list the child processes of the main executable:
$p = (Get-Process app).Id
Get-CimInstance Win32_Process | Where-Object ParentProcessId -eq $p |
Select-Object Name, ProcessId, ExecutablePathA child process that is also slow to start needs its own exclusion; test it the same way.
3. Deploy the exclusion through policy
Add the process exclusion to the Defender policy that manages the machines:
- Intune: Endpoint security > Antivirus > Microsoft Defender Antivirus exclusions, setting Excluded Processes.
- Configuration Manager: Assets and Compliance > Endpoint Protection > Antimalware Policies > Exclusion Settings > Excluded processes.
- Group Policy: Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus > Exclusions > Process Exclusions.
A full path is narrower than a bare file name, which matches a process with that name in any folder. With FlexApp, test which path form Defender accepts before deploying it: the virtual install path (for example C:\Program Files (x86)\Vendor\App\app.exe), or the bare file name. Exclusions built on the FlexApp mount folder (C:\FADIA-T\VHDM\... or C:\F\M\..., depending on the ProfileUnity version) are not recommended: the folder name changes per mount and per client version.
4. Report the files to Microsoft
Submit the application's assemblies through the Microsoft Security Intelligence file submission portal. Include the signature reference from step 5 of Confirm the cause, and explain that each AMSI scan waits 10 seconds for a cloud verdict. Once Microsoft updates the signature or the cloud verdict, the exclusion is no longer needed and can be removed.
5. Inform the application vendor
Share the findings with the application vendor. Files signed with a valid, current code-signing certificate build cloud reputation faster than files whose certificate has expired.
Why path exclusions do not help
A path exclusion stops Defender from scanning files in that folder. AMSI scans are not file scans: Defender receives the content in memory, without a file path, so no path exclusion can match them. A process exclusion works because it applies to everything the excluded process does, including its AMSI scans.
Example measurement on one machine, two starts per variant, with cloud protection and Block at First Sight on:
| Exclusion | Start time | Effect |
|---|---|---|
| None | 137–160 s | 17 AMSI scans, 114–122 s waiting for the cloud |
| Path: virtual install folder | 119–165 s | ⚠File scans skipped, AMSI scans unchanged |
| Path: FlexApp mount folder | 110–115 s | ✗ No effect |
| Process: main executable | 14–23 s | ✓ AMSI scans and cloud waits gone |
Related articles
- Antivirus Exclusion List for ProfileUnity Program Files and Directories
- Microsoft: Performance analyzer for Microsoft Defender Antivirus
- Microsoft: Configure exclusions for files opened by processes
- If the application is still slow with the process exclusion in place, contact Liquidware Support with the recording (
.etlfile) and a ProfileUnity client diagnostic bundle.
| Product | Liquidware ProfileUnity / FlexApp |
| Applies To | .NET Framework applications on machines with Microsoft Defender Antivirus; not specific to a FlexApp version (observed with 6.8.7) |
| Updated | November 12, 2026 |