MSBuildForUnity icon indicating copy to clipboard operation
MSBuildForUnity copied to clipboard

Subdirectory dependencies result in KeyNotFoundException when using full generation enabled

Open loic-lopez opened this issue 4 years ago • 0 comments

Hi everyone,

I'm trying to make some dependencies only available for the Editor mode of Unity for example: Assets/UMVC/Editor/EditorDependencies/UMVC.Editor.Dependencies.msb4u.csproj

And I would like also to have another csproj file for runtime deps as follows: Assets/UMVC/PlayerDependencies/UMVC.Player.Dependencies.msb4u.csproj

And it throws this error:

KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.SortedDictionary`2[TKey,TValue].get_Item (TKey key) (at <ef151b6abb5d474cb2c1cb8906a8b5a4>:0)
Microsoft.Build.Unity.ProjectGeneration.Exporters.TemplatedExporter.TemplatedSolutionExporter.WriteProject (Microsoft.Build.Unity.ProjectGeneration.Exporters.TemplatedExporter.TemplatedWriter solutionWriter, System.Guid projectGuid, Microsoft.Build.Unity.ProjectGeneration.Exporters.SolutionProject project) (at Library/PackageCache/[email protected]/Editor/ProjectGenerator/Scripts/Exporters/TemplatedExporter/TemplatedSolutionExporter.cs:240)
Microsoft.Build.Unity.ProjectGeneration.Exporters.TemplatedExporter.TemplatedSolutionExporter.Write () (at Library/PackageCache/[email protected]/Editor/ProjectGenerator/Scripts/Exporters/TemplatedExporter/TemplatedSolutionExporter.cs:124)
Microsoft.Build.Unity.ProjectGeneration.UnityProjectInfo.ExportSolution (Microsoft.Build.Unity.ProjectGeneration.Exporters.IUnityProjectExporter unityProjectExporter, System.IO.FileInfo solutionFilePath, System.IO.DirectoryInfo generatedProjectsFolder) (at Library/PackageCache/[email protected]/Editor/ProjectGenerator/Scripts/UnityProjectInfo.cs:553)
Microsoft.Build.Unity.ProjectGeneration.MSBuildTools.RegenerateEverything (Microsoft.Build.Unity.ProjectGeneration.UnityProjectInfo unityProjectInfo, System.Boolean completeGeneration) (at Library/PackageCache/[email protected]/Editor/ProjectGenerator/Scripts/MSBuildTools.cs:342)
Microsoft.Build.Unity.ProjectGeneration.MSBuildTools.RefreshGeneratedOutput (System.Boolean forceGenerateEverything, System.Boolean forceCompleteGeneration) (at Library/PackageCache/[email protected]/Editor/ProjectGenerator/Scripts/MSBuildTools.cs:247)
Microsoft.Build.Unity.ProjectGeneration.MSBuildTools.GenerateSDKProjects () (at Library/PackageCache/[email protected]/Editor/ProjectGenerator/Scripts/MSBuildTools.cs:157)

Does is it possible to make some projects reference only available for example the Unity editor?

loic-lopez avatar Sep 02 '21 16:09 loic-lopez