dotnet / dotnet/msbuild

Using /isolate Against Solution with reference to non-managed project type results in MSB4252

Open
#5,162 4 comments 0 reactions 1 assignee Claimed by @cdmihai View on GitHub
Area: Static Graph triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

Attempting the following:

```
msbuild Utilities.sln /m /isolate /t:Build /p:Configuration=Release
```

Results in the following redacted error:

```
Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 3/5/2020 10:03:16 AM.
1>Project "C:\REDACTED\Utilities.sln" on node 1 (Build target(s)).
1>ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".
1>C:\REDACTED\Utilities.sln.metaproj : error : MSB4252: Project "C:\REDACTED\Utilities.sln" has a reference to "C:\REDACTED\Utilities.synproj" (default target(s)) but the build result for the reference is not in the engine cache. In isolated builds this could mean one of the following: [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not explicitly specified as a ProjectReference item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not included in the provided input caches [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was called with a target which is not specified in the ProjectReferenceTargets item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : [C:\REDACTED\Utilities.sln]
1>C:\REDACTED\Utilities.sln.metaproj : error : MSB4252: Project "C:\REDACTED\Utilities.sln" has a reference to "C:\REDACTED\SynergyStructures.synproj" (default target(s)) but the build result for the reference is not in the engine cache. In isolated builds this could mean one of the following: [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not explicitly specified as a ProjectReference item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not included in the provided input caches [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was called with a target which is not specified in the ProjectReferenceTargets item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : [C:\REDACTED\Utilities.sln]
1>C:\REDACTED\Utilities.sln.metaproj : error : MSB4252: Project "C:\REDACTED\Utilities.sln" has a reference to "C:\REDACTED\Repository.synproj" (default target(s)) but the build result for the reference is not in the engine cache. In isolated builds this could mean one of the following: [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not explicitly specified as a ProjectReference item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not included in the provided input caches [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was called with a target which is not specified in the ProjectReferenceTargets item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : [C:\REDACTED\Utilities.sln]
1>Done Building Project "C:\REDACTED\Utilities.sln" (Build target(s)) -- FAILED.

Build FAILED.

"C:\REDACTED\Utilities.sln" (Build target) (1) ->
(Build target) ->
C:\REDACTED\Utilities.sln.metaproj : error : MSB4252: Project "C:\REDACTED\Utilities.sln" has a reference to "C:\REDACTED\Utilities.synproj" (default target(s)) but the build result for the reference is not in the engine cache. In isolated builds this could mean one of the following: [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not explicitly specified as a ProjectReference item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not included in the provided input caches [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was called with a target which is not specified in the ProjectReferenceTargets item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : MSB4252: Project "C:\REDACTED\Utilities.sln" has a reference to "C:\REDACTED\SynergyStructures.synproj" (default target(s)) but the build result for the reference is not in the engine cache. In isolated builds this could mean one of the following: [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not explicitly specified as a ProjectReference item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not included in the provided input caches [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was called with a target which is not specified in the ProjectReferenceTargets item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : MSB4252: Project "C:\REDACTED\Utilities.sln" has a reference to "C:\REDACTED\Repository.synproj" (default target(s)) but the build result for the reference is not in the engine cache. In isolated builds this could mean one of the following: [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not explicitly specified as a ProjectReference item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was not included in the provided input caches [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : - the reference was called with a target which is not specified in the ProjectReferenceTargets item in "C:\REDACTED\Utilities.sln" [C:\REDACTED\Utilities.sln]
C:\REDACTED\Utilities.sln.metaproj : error : [C:\REDACTED\Utilities.sln]

0 Warning(s)
3 Error(s)

Time Elapsed 00:00:00.26
```

The structure of the Solution file (Utilities.sln) looks like this:

```
digraph {
"Utilities.synproj" -> "Repository.synproj"
"Utilities.synproj" -> "SynergyStructures.synproj"
"SynergyStructures.synproj" -> "Repository.synproj"
}
```

![image](https://user-images.githubusercontent.com/2592881/76007604-8a4e9800-5ecb-11ea-9e64-51f985802377.png)

Reading https://github.com/microsoft/msbuild/blob/d004974104fde202e633b3c97e0ece3287aa62f9/documentation/specs/static-graph.md#single-project-isolated-builds-implementation-details I am trying to understand what the root cause of the issue may be?

### Environment data
`msbuild /version` output:

```
Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

16.5.0.12403
```

OS info: Windows 10 1909

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.