Skip to content

AssemblyLoadContext Unload does not release PDB file #66091

Description

@Seabizkit

Description

load zip... create AssemblyLoadContext..
ive managed to successfully unload the dll... but cant delete the containing folder as there still a lock on the pdb

so basically .Unload() is working although i would love more love here interms of examples
but got this to work....

issue is it cant delete the folder as there is a lock on the pdb file

Visual Studo 2022, .net 6

Reproduction Steps

Load dll in AssemblyLoadContext, ensure its unloaded,

delete the folder from which it was loaded, ensure you have a pdb file in there which is linked to the dll file u are loading.

Expected behavior

the file should not be locked. in my case i have quite a few files in the folder, all of which get deleted but the pdb file.

Actual behavior

get an exception that the pdb file is locked.

Regression?

No response

Known Workarounds

I think if i delete the pdf files before loading it might work, about to test

Configuration

.net 6
windows 10 x64
visual studio 2022

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status
No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions