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

Build fails claiming a missing win8 target where none exists nor should need to #7277

Closed
AArnott opened this issue Sep 6, 2018 · 1 comment

Comments

@AArnott
Copy link
Contributor

AArnott commented Sep 6, 2018

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): msbuild.exe /restore

MSBuild version: 15.9.10.28431

dotnet.exe --version (if appropriate): 2.1.500-preview-009266

VS version (if appropriate): 15.9.0 preview 2.0 (28029.51.d15.9)

OS version (i.e. win10 v1607 (14393.321)): 17134.rs4_release.180410-1804

Worked before? If so, with which NuGet version: Not sure.

Detailed repro steps so we can see the same problem

git clone https://github.com/AArnott/pinvoke.git
cd pinvoke\src
git checkout a07ddf382cd43853985b07c75a5edda0ad3374f7
msbuild ole32 /t:restore 
msbuild ole32 /p:targetframework=win8

Expected

A successful restore and build.

Actual

Restore emits no warnings. Build fails with:

C:\Program Files\dotnet\sdk\2.1.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,5): error : Assets file 'D:\git\pinvoke\obj\Windows.Core\project.assets.json' doesn't have a target for 'Windows,Version=v8.0'. Ensure that restore has run and that you have included 'win8' in the TargetFrameworks for your project. [D:\git\pinvoke\src\Windows.Core\Windows.Core.csproj]
C:\Program Files\dotnet\sdk\2.1.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,5): error : Assets file 'D:\git\pinvoke\obj\CodeGenerationAttributes\project.assets.json' doesn't have a target for 'Windows,Version=v8.0'. Ensure that restore has run and that you have included 'win8' in the TargetFrameworks for your project. [D:\git\pinvoke\src\CodeGenerationAttributes\CodeGenerationAttributes.csproj]

Trying to build again (without another restore step) usually succeeds (but not always). Considering the error is allegedly generated from the Windows.Core.csproj and CodeGenerationAttributes.csproj projects, building them individually might presumably fail, but they don't. They only fail when in the context of the larger build.

I claim this is a nuget/msbuild failure because while it is true that the two mentioned projects do not define a win8 target, they shouldn't need to, since they include netstandard1.1 as one of their targets, which per this table should work for any win8 targeted project that references these projects. Also since the failure is inconsistent (a second or third build attempt usually succeeds), it seems like some race condition perhaps during the multi-proc build. Or maybe incremental build is buggy and skips the previously failed build step.

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

1 participant