Skip to content

Commit c9d025d

Browse files
author
Cam Soper
authored
[Breaking change]: On Windows in .NET 9, the assembly load directory resolves through symbolic links (#45627)
* [Breaking change]: On Windows in .NET 9, the assembly load directory resolves through symbolic links Fixes #45584 * ToC and .NET 9 overview * Fix contraction in assembly load directory documentation
1 parent d3bab3f commit c9d025d

File tree

3 files changed

+82
-4
lines changed

3 files changed

+82
-4
lines changed

docs/core/compatibility/9.0.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Breaking changes in .NET 9
33
titleSuffix: ""
44
description: Navigate to the breaking changes in .NET 9.
5-
ms.date: 03/26/2025
5+
ms.date: 04/03/2025
66
no-loc: [Blazor, Razor, Kestrel]
77
---
88
# Breaking changes in .NET 9
@@ -68,9 +68,10 @@ If you're migrating an app to .NET 9, the breaking changes listed here might aff
6868

6969
## Deployment
7070

71-
| Title | Type of change | Introduced version |
72-
|-----------------------------------------------------------------------------------------------------|---------------------|--------------------|
73-
| [Deprecated desktop Windows/macOS/Linux MonoVM runtime packages](deployment/9.0/monovm-packages.md) | Source incompatible | Preview 7 |
71+
| Title | Type of change | Introduced version |
72+
|-----------------------------------------------------------------------------------------------------------------|---------------------|--------------------|
73+
| [Deprecated desktop Windows/macOS/Linux MonoVM runtime packages](deployment/9.0/monovm-packages.md) | Source incompatible | Preview 7 |
74+
| [Assembly load directory resolves through symbolic links on Windows](deployment/9.0/assembly-load-directory.md) | Behavioral change | GA |
7475

7576
## Interop
7677

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: "Breaking change - Assembly load directory resolves through symbolic links on Windows"
3+
description: "Learn about the breaking change in .NET 9 where the assembly load directory resolves through symbolic links."
4+
ms.date: 4/3/2025
5+
ai-usage: ai-assisted
6+
ms.custom: https://github.com/dotnet/docs/issues/45584
7+
---
8+
9+
# Assembly load directory resolves through symbolic links on Windows
10+
11+
Starting in .NET 9, the .NET host resolves symbolic links before determining the assembly load directory when running on Windows.
12+
13+
## Version introduced
14+
15+
.NET 9
16+
17+
## Previous behavior
18+
19+
The .NET host didn't resolve symbolic links before calculating load paths. Assembly loads were resolved relative to the symbolic link itself, not the destination of the link.
20+
21+
For example, if an application was laid out as follows:
22+
23+
```
24+
/myapp/
25+
myapp.exe
26+
myapp.dll
27+
```
28+
29+
And a symbolic link was created in another directory:
30+
31+
```
32+
otherdir/
33+
myapp.exe -> /myapp/myapp.exe
34+
```
35+
36+
Executing `otherdir/myapp.exe` would resolve loads relative to `otherdir/`, not `/myapp/`.
37+
38+
## New behavior
39+
40+
The .NET host now resolves the destination of a symbolic link before determining the assembly load directory. Assembly loads are resolved relative to the resolved location of the host file.
41+
42+
Using the same example:
43+
44+
```
45+
/myapp/
46+
myapp.exe
47+
myapp.dll
48+
```
49+
50+
With a symbolic link:
51+
52+
```
53+
otherdir/
54+
myapp.exe -> /myapp/myapp.exe
55+
```
56+
57+
Executing `otherdir/myapp.exe` resolves loads relative to `/myapp/`. Files in `otherdir/` are not considered.
58+
59+
## Type of breaking change
60+
61+
This is a [behavioral change](../../categories.md#behavioral-change).
62+
63+
## Reason for change
64+
65+
The previous behavior on Windows was undocumented, inconsistent with non-Windows implementations, and prevented supported use of symbolic links to the .NET host. This change ensures consistent behavior and enables scenarios where symbolic links to the .NET host are used properly.
66+
67+
## Recommended action
68+
69+
If your application relied on the previous behavior, ensure that all relevant binaries are located in the directory behind the symbolic link, rather than next to it. Avoid constructing a file layout that depends on the symbolic link's location.
70+
71+
## Affected APIs
72+
73+
None.

docs/core/compatibility/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ items:
140140
items:
141141
- name: Deprecated desktop Windows/macOS/Linux MonoVM runtime packages
142142
href: deployment/9.0/monovm-packages.md
143+
- name: Assembly load directory resolves through symbolic links on Windows
144+
href: deployment/9.0/assembly-load-directory.md
143145
- name: Entity Framework Core
144146
href: /ef/core/what-is-new/ef-core-9.0/breaking-changes?toc=/dotnet/core/compatibility/toc.json&bc=/dotnet/breadcrumb/toc.json
145147
- name: Interop
@@ -1678,6 +1680,8 @@ items:
16781680
items:
16791681
- name: Deprecated desktop Windows/macOS/Linux MonoVM runtime packages
16801682
href: deployment/9.0/monovm-packages.md
1683+
- name: Assembly load directory resolves through symbolic links on Windows
1684+
href: deployment/9.0/assembly-load-directory.md
16811685
- name: .NET 8
16821686
items:
16831687
- name: Host determines RID-specific assets

0 commit comments

Comments
 (0)