Skip to content

Commit e176d19

Browse files
radekdoulikjonpryor
authored andcommitted
[Xamarin.Android.Build.Tasks] Improve error message to provide info about unresolved refs (#218)
- fixes #43515 - the message was missing the scope information (a typo?) and was a bit misleading. hopefully it will make more sense now - added note about forwarded types, as it is reached in scenarios like this: an app references an assembly lib1 containing type forwarder to type in another assembly lib2. when this other assembly lib2 doesn't contain the type and the app doesn't reference that type directly, but only thru code in lib1, the compiler doesn't detect the type is missing. the linker OTOH will try to resolve the reference and the error is reached
1 parent 10b1c2a commit e176d19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Xamarin.Android.Build.Tasks/Tasks/LinkAssemblies.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public override bool Execute ()
155155
}
156156
}
157157
} catch (ResolutionException ex) {
158-
Diagnostic.Error (2006, ex, "Reference to metadata item '{0}' (defined in '{1}') from '{1}' could not be resolved.", ex.Member, ex.Member.Module.Assembly, ex.Scope);
158+
Diagnostic.Error (2006, ex, "Could not resolve reference to '{0}' (defined in assembly '{1}') with scope '{2}'. When the scope is different from the defining assembly, it usually means that the type is forwarded.", ex.Member, ex.Member.Module.Assembly, ex.Scope);
159159
}
160160

161161
return true;

0 commit comments

Comments
 (0)