Yes, you can can code coverage data from a ASP.NET project. And it's simple as @riQQ suggested in this thread.
The following content is for supplements and reproduce @riQQ's answer in above thread.
Prepared a webform app and .net framework unit test, added the coverlet.runsettings file in repo, the content refering Coverlet options supported by VSTest integration:
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Format>json,cobertura</Format>
<Exclude>[coverlet.*.tests?]*,[*]Coverlet.Core*</Exclude> <!-- [Assembly-Filter]Type-Filter -->
<Include>[coverlet.*]*,[*]Coverlet.Core*</Include> <!-- [Assembly-Filter]Type-Filter -->
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
<ExcludeByFile>../dir1/class1.cs,../dir2/*.cs,../dir3/**/*.cs,</ExcludeByFile> <!-- Absolute or relative file paths -->
<IncludeDirectory>../dir1/,../dir2/,</IncludeDirectory>
<SingleHit>false</SingleHit>
<UseSourceLink>true</UseSourceLink>
<IncludeTestAssembly>true</IncludeTestAssembly>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
Configure the VSTest task:

It can generate the coverage file successfully:
Passed TestMethod1
Results File: D:\a\_temp\TestResults\VssAdministrator_fv-az38_2020-03-17_07_53_28.trx
Attachments:
D:\a\_temp\TestResults\*******-****-****-****-**********\VssAdministrator_fv-az38 2020-03-17 07_53_18.coverage
Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
Test Run Successful.
Note: If you want to run this build on self hosted agent, you might need to make sure the VS Enterprise is installed, refer to "Cannot find CodeCoverage.exe" on self-hosted agent.