Fix for netstandard projects (#1382)
* [XamlC] treat netstandard types as mscorlib (#1281) If the end user project type differs from Core's type, the compiler can be confused while comparing base styles, like System.Double. this fixes that by assuming System.Runtime, mscorlib and netstnadard types are equivalent (because they are) * [C] fix an issue with netstandard when context type is object (#1282) * [XamlC] fix typo fixes #1316, fixes #1368
This commit is contained in:
Родитель
1328eca7be
Коммит
d7e1569b13
|
@ -24,11 +24,16 @@ namespace Xamarin.Forms.Build.Tasks
|
|||
if (x.FullName != y.FullName)
|
||||
return false;
|
||||
var xasm = GetAssembly(x);
|
||||
if (xasm.StartsWith("System.Runtime", StringComparison.Ordinal) || xasm.StartsWith("mscorlib", StringComparison.Ordinal))
|
||||
xasm = "mscorlib";
|
||||
var yasm = GetAssembly(y);
|
||||
if (yasm.StartsWith("System.Runtime", StringComparison.Ordinal) || yasm.StartsWith("mscorlib", StringComparison.Ordinal))
|
||||
yasm = "mscorlib";
|
||||
|
||||
//standard types comes from either mscorlib. System.Runtime or netstandard. Assume they are equivalent
|
||||
if ( (xasm.StartsWith("System.Runtime", StringComparison.Ordinal)
|
||||
|| xasm.StartsWith("mscorlib", StringComparison.Ordinal)
|
||||
|| xasm.StartsWith("netstandard", StringComparison.Ordinal))
|
||||
&& (yasm.StartsWith("System.Runtime", StringComparison.Ordinal)
|
||||
|| yasm.StartsWith("mscorlib", StringComparison.Ordinal)
|
||||
|| yasm.StartsWith("netstandard", StringComparison.Ordinal)))
|
||||
return true;
|
||||
return xasm == yasm;
|
||||
}
|
||||
|
||||
|
|
|
@ -316,11 +316,7 @@ namespace Xamarin.Forms
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
property = sourceType.GetDeclaredProperty(part.Content);
|
||||
if (property == null)
|
||||
property = sourceType.BaseType.GetProperty(part.Content);
|
||||
}
|
||||
property = sourceType.GetDeclaredProperty(part.Content) ?? sourceType.BaseType?.GetProperty(part.Content);
|
||||
|
||||
if (property != null)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче