Files are represented in the file system by two major structures. First is the directory entry, it stores metadata about the file. Like the file name, size, attributes and time stamps. Next is the chain of clusters that store the file data.
Loading an assembly causes a memory mapped file to be created for the assembly. An optimization, it ensures that you only pay for the parts of the assembly you'll actually use. The file data won't be read into RAM until it is actually needed. A core feature of a demand-paged virtual memory operating system like Windows.
The memory mapped file puts a lock on the file to ensure the file data cannot be changed by another process. That would be disastrous, the data in RAM would not match the data in the file anymore. Locks in Windows only protect the file data, not the metadata for the file. Or in other words, you can still modify the directory entry for the file, as long as that doesn't also modify the file data.
So renaming the file is not a problem, that only modifies the directory entry. Even moving the file from one directory to another is not a problem, that only changes the location of the directory entry, it doesn't modify the file data as long as file is large enough to require clusters. Moving the file from one drive to another is a problem since that requires a copy that also deletes the original file data. Deleting the file is not possible, that also deletes the file data.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…