diff options
author | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2019-01-17 07:04:41 +0300 |
---|---|---|
committer | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2019-01-17 07:29:30 +0300 |
commit | e4fe9d5d4bf9f8d299d97dc2a773332e9f50b1cb (patch) | |
tree | e9f47dee9e0273dbdfb7fbec0e701ace0d87d59d /main/msbuild | |
parent | 8667d53f6f91e1fb94b0975386cc19e2251ad268 (diff) |
Work around .NET SDK transitive copy bug
https://github.com/dotnet/sdk/issues/1366
Diffstat (limited to 'main/msbuild')
-rw-r--r-- | main/msbuild/MonoDevelop.AfterCommon.targets | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/main/msbuild/MonoDevelop.AfterCommon.targets b/main/msbuild/MonoDevelop.AfterCommon.targets index d526629881..35d38812ce 100644 --- a/main/msbuild/MonoDevelop.AfterCommon.targets +++ b/main/msbuild/MonoDevelop.AfterCommon.targets @@ -6,4 +6,31 @@ <Import Project="$(MSBuildThisFileDirectory)\GenerateInternalsVisibleTo.targets" /> <Import Project="$(MSBuildThisFileDirectory)\MDBuildTasks.targets" /> + + + <!-- + Disable transitive project references in SDK style projects. + + Right now, if project B has a private (i.e. the default) project reference to project A + and project project C has a *non-private* ref to project B, project C will transitively + get a *private ref* to project A. + + This seems very wrong, and is very much NOT what we want. + + Extensions reference each other with non-private refs so we only get one copy of + each dll in the app. This breaks that. + + Setting PrivateAssets="runtime,contentFiles" on the private reference does NOT + fix it, hence this horrible hack. + + https://github.com/dotnet/sdk/issues/1366 + + --> + <Target Name="_MakeTransitiveProjectRefsNonPrivate" AfterTargets="IncludeTransitiveProjectReferences"> + <ItemGroup> + <!-- remove the transitive project references and re-add them as non-private project references --> + <ProjectReference Remove="@(_TransitiveProjectReferences)" /> + <ProjectReference Include="@(_TransitiveProjectReferences)" Private="False" /> + </ItemGroup> + </Target> </Project> |