You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a .NET 4.7 project which, as part of its build, runs a .NET Core CLI program to generate one of its source files using the BeforeBuild target and <Exec>. Because of this I want the generator to build before my project, so the .sln file has a dependency in the form of ProjectSection(ProjectDependencies) = postProject.
Expected behavior
The build works from within VS. I expect it to work from a command line MSBuild, because I in fact don't reference the .NET Core project, just call it as any other CLI tool. The fact that it's .NET Core is irrelevant, it could be C++.
Actual behavior
[GetReferenceNearestTargetFrameworkTask] C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1656, 5): Project 'C:\[snip...]\csharp_gen.csproj' targets 'netcoreapp2.1'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.7'.
Environment data
msbuild /version output:
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
15.7.179.6572
OS info: Win7 x64, latest updates as of today
If applicable, version of the tool that invokes MSBuild (Visual Studio, dotnet CLI, etc):
msbuild.exe is being run standalone
The text was updated successfully, but these errors were encountered:
Steps to reproduce
I have a .NET 4.7 project which, as part of its build, runs a .NET Core CLI program to generate one of its source files using the
BeforeBuild
target and<Exec>
. Because of this I want the generator to build before my project, so the .sln file has a dependency in the form ofProjectSection(ProjectDependencies) = postProject
.Expected behavior
The build works from within VS. I expect it to work from a command line MSBuild, because I in fact don't reference the .NET Core project, just call it as any other CLI tool. The fact that it's .NET Core is irrelevant, it could be C++.
Actual behavior
[GetReferenceNearestTargetFrameworkTask] C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1656, 5): Project 'C:\[snip...]\csharp_gen.csproj' targets 'netcoreapp2.1'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.7'.
Environment data
msbuild /version
output:OS info: Win7 x64, latest updates as of today
If applicable, version of the tool that invokes MSBuild (Visual Studio, dotnet CLI, etc):
msbuild.exe is being run standalone
The text was updated successfully, but these errors were encountered: