Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution dependencies fail due to RuntimeIdentifier being forwarded #139

Open
xen2 opened this issue Dec 12, 2018 · 2 comments
Open

Solution dependencies fail due to RuntimeIdentifier being forwarded #139

xen2 opened this issue Dec 12, 2018 · 2 comments

Comments

@xen2
Copy link
Contributor

xen2 commented Dec 12, 2018

I have a project with multiple RuntimeIdentifiers and it fails to build a solution reference which doesn't have a RuntimeIdentifier.

Error is

Assets file 'C:\DEV\xenko\sources\core\Xenko.Core.Tasks\obj\project.assets.json' doesn't have a target for '.NETFramework,Version=v4.7.2/win7-d3d11'. Ensure that restore has run and that you have included 'net472' in the TargetFrameworks for your project. You may also need to include 'win7-d3d11' in your project's RuntimeIdentifiers.

I think what it needs is to have RuntimeIdentifier in the ProjectReferenceWithConfiguration.GlobalPropertiesToRemove:
image

MSBuild code reference (where TargetFramework is hardcoded):
https://github.com/Microsoft/msbuild/blob/e77fa08888dbf7d6478b7659aeaccc39ce04c435/src/Tasks/ResolveProjectBase.cs#L280

@xen2
Copy link
Contributor Author

xen2 commented Dec 12, 2018

I could fix the problem with this kind of target:

  <Target Name="_XenkoRemoveRuntimeIdentifierFromSolutionDependencies" AfterTargets="AssignProjectConfiguration">
    <ItemGroup>
      <ProjectReferenceWithConfiguration Condition="'%(ProjectReferenceWithConfiguration.ReferenceSourceTarget)' != 'ProjectReference'">
        <GlobalPropertiesToRemove>%(ProjectReferenceWithConfiguration.GlobalPropertiesToRemove);RuntimeIdentifier</GlobalPropertiesToRemove>
      </ProjectReferenceWithConfiguration>
    </ItemGroup>
  </Target>

@clairernovotny
Copy link
Collaborator

Can you please submit a PR with the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants