diff --git a/changes/bug2077_share_delete b/changes/bug2077_share_delete
new file mode 100644
index 0000000000000000000000000000000000000000..71e9160538a53830595e0d7dc6b7b92f2bbf6d87
--- /dev/null
+++ b/changes/bug2077_share_delete
@@ -0,0 +1,7 @@
+  o Major bugfixes (windows):
+    - Open files to be mapped with FILE_SHARE_DELETE so that we can
+      replace them before closing the mapping. This is a likely cause of
+      warnings and crashes when replacing the microdescriptor cache
+      file. Diagnosed based on comments by "doorss" and by Robert
+      Ransom. Possible fix for bug 2077; bugfix on 0.2.2.6-alpha.
+
diff --git a/src/common/compat.c b/src/common/compat.c
index 59e3898debd6e14d808f6ccb609a11f934f2b358..7f7405f6fd23038818c47cf16b67db7fc5332239 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -238,7 +238,7 @@ tor_mmap_file(const char *filename)
   strlcpy(tfilename,filename,MAX_PATH);
 #endif
   file_handle = CreateFile(tfilename,
-                           GENERIC_READ, FILE_SHARE_READ,
+                           GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_DELETE,
                            NULL,
                            OPEN_EXISTING,
                            FILE_ATTRIBUTE_NORMAL,