Commit f52dddf
committed
[xabuild] MSBuild assemblies should not "Copy Local"
Mono 2018-04 (or 5.14.x) has some changes to MSBuild assemblies that
cause the following failure when using `xabuild.exe`:
Mono: The following assembly referenced from monodroid/external/xamarin-android/bin/Debug/bin/Microsoft.Build.Tasks.Core.dll could not be loaded:
Assembly: System.Reflection.Metadata (assemblyref_index=7)
Version: 1.3.0.0
Public Key: b03f5f7f11d50a3a
Currently `xabuild.exe` is referencing various MSBuild assemblies that
get copied into `bin/$(Configuration)/bin` and shipped in the OSS zip.
This isn't exactly desirable, since we don't really want to ship these
assemblies... These assemblies are OS-specific (as far as I can tell),
I noticed that these assemblies coming from a zip built on macOS do
not work on Windows.
So instead, we can use `Private=False` item metadata on all MSBuild
references and use custom assembly loading. By using the
`AppDomain.AssemblyResolve` event, we can add some code to probe the
MSBuild bin directory for assemblies. If not found, we can return
`null` and let the runtime do its default behavior.1 parent 2cae443 commit f52dddf
File tree
3 files changed
+42
-4
lines changed- build-tools/scripts
- tools/xabuild
3 files changed
+42
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
3 | 2 | | |
4 | 3 | | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
12 | 35 | | |
13 | 36 | | |
14 | 37 | | |
15 | | - | |
16 | 38 | | |
17 | 39 | | |
18 | 40 | | |
| |||
45 | 67 | | |
46 | 68 | | |
47 | 69 | | |
48 | | - | |
| 70 | + | |
49 | 71 | | |
50 | 72 | | |
51 | 73 | | |
| |||
165 | 187 | | |
166 | 188 | | |
167 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
168 | 200 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
0 commit comments