diff --git a/.nuspec/Xamarin.Forms.targets b/.nuspec/Xamarin.Forms.targets index cd9f89fce33..2a3e666293e 100644 --- a/.nuspec/Xamarin.Forms.targets +++ b/.nuspec/Xamarin.Forms.targets @@ -84,8 +84,7 @@ Inputs="@(_XamlGInputs)" Outputs="@(_XamlGOutputs)"> - @(ReferencePath) - $(_ReferencedAssemblies) + @(ReferencePath) (); _xmlnsModules = new Dictionary(); - if (string.IsNullOrEmpty(References)) - return; - - string[] paths = References.Split(';').Distinct().ToArray(); + var paths = References?.Split(';').Distinct().ToList() ?? new List(); + //Load xmlnsdef from Core and Xaml + paths.Add(typeof(Label).Assembly.Location); + paths.Add(typeof(Xamarin.Forms.Xaml.Extensions).Assembly.Location); foreach (var path in paths) { string asmName = IOPath.GetFileName(path); @@ -430,9 +430,9 @@ CodeTypeReference GetCustomNamespaceUrlType(XmlType xmlType) null, (typeInfo) => { - ModuleDefinition module = null; - if (typeInfo.AssemblyName == null || !_xmlnsModules.TryGetValue(typeInfo.AssemblyName, out module)) + if (typeInfo.AssemblyName == null || !_xmlnsModules.TryGetValue(typeInfo.AssemblyName, out ModuleDefinition module)) return null; + string typeName = typeInfo.TypeName.Replace('+', '/'); //Nested types string fullName = $"{typeInfo.ClrNamespace}.{typeInfo.TypeName}"; return module.Types.Where(t => t.FullName == fullName).FirstOrDefault(); diff --git a/Xamarin.Forms.Xaml.UnitTests/MSBuild/MSBuildTests.cs b/Xamarin.Forms.Xaml.UnitTests/MSBuild/MSBuildTests.cs index fd3c1847ecb..cfff0eceaf7 100644 --- a/Xamarin.Forms.Xaml.UnitTests/MSBuild/MSBuildTests.cs +++ b/Xamarin.Forms.Xaml.UnitTests/MSBuild/MSBuildTests.cs @@ -140,11 +140,6 @@ XElement NewProject (bool sdkStyle) propertyGroup.Add (NewElement ("TargetFrameworkVersion").WithValue ("v4.7")); propertyGroup.Add(NewElement("RootNamespace").WithValue("test")); } - var refpath = string.Join(";", - IOPath.Combine("..", "..", "Xamarin.Forms.Core.dll"), - IOPath.Combine("..", "..", "Xamarin.Forms.Xaml.dll")); - propertyGroup.Add(NewElement("_ReferencedAssemblies").WithValue($"{refpath}")); - propertyGroup.Add(NewElement("_XFBuildTasksLocation").WithValue($"{testDirectory}\\"));