Skip to content

Solution-Level Project Dependencies require framework compatibility between projects in metaproj #1915

@jkoritzinsky

Description

@jkoritzinsky

If you build a VS solution that has project dependencies outside of project references from the command line with MSBuild, the metaproj requires that the two projects have compatible frameworks. Sometimes this is not desirable (i.e. building a tool used to codegen before building projects that use the generated code). I have
an example that has a .NET Core project that has a Project Dependency on a .NET 4.5 project. It builds successfully in VS, but command line MSBuild fails with the following:

"C:\Users\jkori\OneDrive\Documents\Visual Studio 2017\Projects\MetaProjectSolutionDependencies\MetaProjectSolutionDepen
dencies.sln" (default target) (1) ->
"C:\Users\jkori\OneDrive\Documents\Visual Studio 2017\Projects\MetaProjectSolutionDependencies\NetCore\NetCore.csproj.m
etaproj" (default target) (2) ->
"C:\Users\jkori\OneDrive\Documents\Visual Studio 2017\Projects\MetaProjectSolutionDependencies\NetCore\NetCore.csproj"
(default target) (4) ->
"C:\Users\jkori\OneDrive\Documents\Visual Studio 2017\Projects\MetaProjectSolutionDependencies\NetFramework\NetFramewor
k.csproj" (GetTargetFrameworkProperties target) (3:2) ->
(GetTargetFrameworkProperties target) ->
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.
Common.targets(73,5): error : Project 'C:\Users\jkori\OneDrive\Documents\Visual Studio 2017\Projects\MetaProjectSolutio
nDependencies\NetFramework\NetFramework.csproj' targets '.NETFramework,Version=v4.5'. It cannot be referenced by a proj
ect that targets '.NETCoreApp,Version=v1.1'. [C:\Users\jkori\OneDrive\Documents\Visual Studio 2017\Projects\MetaProject
SolutionDependencies\NetFramework\NetFramework.csproj]

    0 Warning(s)
    1 Error(s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions