bjorkstromm / depends

Tool for generating dependency trees for .NET projects
MIT License
537 stars 41 forks source link

GenerateDepsFile fails when project has dependency on other project with an AssemblyName property #33

Open remoba opened 7 months ago

remoba commented 7 months ago

When trying to analyze a simple solution using the latest tool version (0.7.0) I am getting the following error:

fail: Buildalyzer.Logging.EventProcessor[0]
      The "GenerateDepsFile" task failed unexpectedly.
      System.IO.FileNotFoundException: C:\Users\mobaral\Downloads\ErrorRepro\Project1\bin\Debug\net6.0\OtherName.dll
         at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)
         at Microsoft.NET.Build.Tasks.FileUtilities.GetFileVersion(String sourcePath)
         at Microsoft.NET.Build.Tasks.DependencyContextBuilder.CreateRuntimeFile(String path, String fullPath)
         at Microsoft.NET.Build.Tasks.DependencyContextBuilder.Build()
         at Microsoft.NET.Build.Tasks.GenerateDepsFile.WriteDepsFile(String depsFilePath)
         at Microsoft.NET.Build.Tasks.TaskBase.Execute()
         at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
         at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

Note that afterwards, the dependency window opens as normal, so this appears to just be noise, but I am looking for a way to suppress it.

This error is only thrown when my solution contains a project (Project2) that depends on another project (Project1), with that project (Project1) having an AssemblyName property.

I've attached a sample solution for reproduction, simply unzip and run dotnet depends on the root

ErrorRepro.zip