diff --git a/Source/MSBuildTools.Unity/Packages/com.microsoft.msbuildforunity/Editor/ProjectGenerator/Scripts/UnityProjectInfo.cs b/Source/MSBuildTools.Unity/Packages/com.microsoft.msbuildforunity/Editor/ProjectGenerator/Scripts/UnityProjectInfo.cs index af4ea3b..5906df7 100644 --- a/Source/MSBuildTools.Unity/Packages/com.microsoft.msbuildforunity/Editor/ProjectGenerator/Scripts/UnityProjectInfo.cs +++ b/Source/MSBuildTools.Unity/Packages/com.microsoft.msbuildforunity/Editor/ProjectGenerator/Scripts/UnityProjectInfo.cs @@ -26,6 +26,14 @@ public class UnityProjectInfo : IDisposable "Windows.UI.Input.Spatial" }; + /// + /// For some Unity packages, references don't match the appropriate asmdef name. + /// + private static readonly Dictionary ProjectAliases = new Dictionary() + { + { "Unity.ugui", "UnityEngine.UI" } + }; + /// /// Gets the name of this Unity Project. /// @@ -261,8 +269,16 @@ private CSProjectInfo GetProjectInfo(Dictionary projectsM if (!asmDefInfoMap.TryGetValue(projectKey, out AssemblyDefinitionInfo assemblyDefinitionInfo)) { - Debug.Log($"Can't find an asmdef for project: {projectKey}; Unity actually allows this, so proceeding."); - return null; + if (ProjectAliases.TryGetValue(projectKey, out string projectAlias) && asmDefInfoMap.TryGetValue(projectAlias, out assemblyDefinitionInfo)) + { + Debug.Log($"A reference was found for {projectKey}, which has known project alias ({projectAlias}). References were made to {projectAlias} instead of {projectKey}."); + projectKey = projectAlias; + } + else + { + Debug.Log($"Can't find an asmdef for project: {projectKey}; Unity actually allows this, so proceeding."); + return null; + } } CSProjectInfo toReturn = new CSProjectInfo(this, assemblyDefinitionInfo);