mono / monodevelop

MonoDevelop is a cross platform .NET IDE
http://www.monodevelop.com
2.82k stars 1.01k forks source link

MonoDevelop build: redefine AssemblySearchPaths #4102

Open KirillOsenkov opened 6 years ago

KirillOsenkov commented 6 years ago

Currently AssemblySearchPaths is the default:

      {CandidateAssemblyFiles};
      ;
      {HintPathFromItem};
      {TargetFrameworkDirectory};
      {AssemblyFoldersFromConfig:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\AssemblyFolders.config,v4.6.1};
      {Registry:Software\Microsoft\.NETFramework,v4.6.1,AssemblyFoldersEx};
      {AssemblyFolders};
      {GAC};
      {RawFileName};
      ..\..\..\build\bin\

and this is very bad, because our build is very non-deterministic. Instead, it should be:

{CandidateAssemblyFiles};{HintPathFromItem};{TargetFrameworkDirectory};{RawFileName};..\..\..build\bin

The output directory also has no business being there, but we heavily rely on it currently, so we can't fix it easily right now.

VS bug #587463

slluis commented 6 years ago

Where is this set?

KirillOsenkov commented 6 years ago

In two places in Microsoft.Common.CurrentVersions.targets in MSBuild:

http://source.dot.net/#MSBuildFiles/C/ProgramFiles(x86)/MicrosoftVisualStudio/2017/Enterprise/MSBuild/15.0/Bin_/Microsoft.Common.CurrentVersion.targets,563

http://source.dot.net/#MSBuildFiles/C/ProgramFiles(x86)/MicrosoftVisualStudio/2017/Enterprise/MSBuild/15.0/Bin_/Microsoft.Common.CurrentVersion.targets,1148

The SDK targets are already much better: http://source.dot.net/#MSBuildFiles/C/ProgramFiles/dotnet/sdk/2.1.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.props,93

KirillOsenkov commented 6 years ago

I can work on this, I can prepare a PR.

slluis commented 6 years ago

So this is not a MonoDevelop bug.

KirillOsenkov commented 6 years ago

Kind of an infrastructure improvement - additional verification that our binaries are resolved from where we think they're resolved from. Let me know if you'd like to track this differently.

Therzok commented 6 years ago

@KirillOsenkov we also need to resolve from addin bin folders. I'm looking at this now, but it seems complicated to fix all in all.