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

Microsoft.Build.Traversal: GetNativeManifest and FindUnderPath errors when attempting to build #34

Closed
NickCraver opened this issue May 26, 2018 · 3 comments

Comments

@NickCraver
Copy link
Member

NickCraver commented May 26, 2018

I'm not sure if this belongs here or MSBuild, but I'm getting the following when attempting to use Traversal as suggested in dotnet/msbuild#1730 (comment):

λ dotnet build PackageBuild.csproj -c Release /p:CI=true
Microsoft (R) Build Engine version 15.6.84.34536 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 60.71 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.EF6\MiniProfiler.EF6.csproj.
  Restore completed in 58.76 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore\MiniProfiler.AspNetCore.csproj.
  Restore completed in 59.64 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore.Mvc\MiniProfiler.AspNetCore.Mvc.csproj.
  Restore completed in 1.66 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.Redis\MiniProfiler.Providers.Redis.csproj.
  Restore completed in 0.64 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.SqlServerCe\MiniProfiler.Providers.SqlServerCe.csproj.
  Restore completed in 7.52 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.Shared\MiniProfiler.Shared.csproj.
  Restore completed in 2.23 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.SqlServer\MiniProfiler.Providers.SqlServer.csproj.
  Restore completed in 0.58 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler\MiniProfiler.csproj.
  Restore completed in 4.3 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.Sqlite\MiniProfiler.Providers.Sqlite.csproj.
  Restore completed in 26.68 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore.Mvc\MiniProfiler.AspNetCore.Mvc.csproj.
  Restore completed in 27 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore.Mvc\MiniProfiler.AspNetCore.Mvc.csproj.
  Restore completed in 0.85 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.Mvc5\MiniProfiler.Mvc5.csproj.
  Restore completed in 2.41 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.EntityFrameworkCore\MiniProfiler.EntityFrameworkCore.csproj.
  Restore completed in 1.62 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.MySql\MiniProfiler.Providers.MySql.csproj.
  Restore completed in 7.32 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.MongoDB\MiniProfiler.Providers.MongoDB.csproj.
  Restore completed in 2.64 ms for C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.RavenDB\MiniProfiler.Providers.RavenDB.csproj.

  Bundler: Begin processing bundleconfig.json

  Bundler: Begin processing bundleconfig.json

  Bundler: Begin processing bundleconfig.json
  Bundler: Done processing bundleconfig.json
  Bundler: Done processing bundleconfig.json
  Bundler: Done processing bundleconfig.json
  MiniProfiler.Shared -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Shared\bin\Release\netstandard1.5\MiniProfiler.Shared.dll
  MiniProfiler.Shared -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Shared\bin\Release\netstandard2.0\MiniProfiler.Shared.dll
  MiniProfiler.Shared -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Shared\bin\Release\net461\MiniProfiler.Shared.dll
  MiniProfiler.EntityFrameworkCore -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.EntityFrameworkCore\bin\Release\netstandard2.0\MiniProfiler.EntityFrameworkCore.dll
  MiniProfiler.EF6 -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.EF6\bin\Release\net461\MiniProfiler.EF6.dll
  MiniProfiler.Providers.Sqlite -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.Sqlite\bin\Release\netstandard1.5\MiniProfiler.Providers.Sqlite.dll
  MiniProfiler.Providers.RavenDB -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.RavenDB\bin\Release\netstandard1.5\MiniProfiler.Providers.RavenDB.dll
  MiniProfiler.AspNetCore -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore\bin\Release\netstandard1.5\MiniProfiler.AspNetCore.dll
  MiniProfiler.Providers.SqlServer -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.SqlServer\bin\Release\netstandard1.5\MiniProfiler.Providers.SqlServer.dll
  MiniProfiler -> C:\git\MiniProfiler\dotnet\src\MiniProfiler\bin\Release\net461\MiniProfiler.dll
  MiniProfiler.Providers.MySql -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.MySql\bin\Release\net461\MiniProfiler.Providers.MySql.dll
  MiniProfiler.Providers.MongoDB -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.MongoDB\bin\Release\net461\MiniProfiler.Providers.MongoDB.dll
  MiniProfiler.Providers.MySql -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.MySql\bin\Release\netstandard1.6\MiniProfiler.Providers.MySql.dll
  MiniProfiler.AspNetCore -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore\bin\Release\net461\MiniProfiler.AspNetCore.dll
  MiniProfiler.Providers.RavenDB -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.RavenDB\bin\Release\net461\MiniProfiler.Providers.RavenDB.dll
  MiniProfiler.Providers.MongoDB -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.MongoDB\bin\Release\netstandard1.5\MiniProfiler.Providers.MongoDB.dll
  MiniProfiler.Providers.Redis -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.Redis\bin\Release\netstandard1.5\MiniProfiler.Providers.Redis.dll
  MiniProfiler.Providers.SqlServer -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.SqlServer\bin\Release\net461\MiniProfiler.Providers.SqlServer.dll
  MiniProfiler.Providers.Sqlite -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.Sqlite\bin\Release\netstandard2.0\MiniProfiler.Providers.Sqlite.dll
  MiniProfiler.Providers.Redis -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.Redis\bin\Release\net461\MiniProfiler.Providers.Redis.dll
  MiniProfiler.Providers.SqlServerCe -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.SqlServerCe\bin\Release\net461\MiniProfiler.Providers.SqlServerCe.dll
  MiniProfiler.Providers.Sqlite -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.Sqlite\bin\Release\net461\MiniProfiler.Providers.Sqlite.dll
  MiniProfiler.AspNetCore -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore\bin\Release\netstandard2.0\MiniProfiler.AspNetCore.dll
  MiniProfiler.Mvc5 -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Mvc5\bin\Release\net461\MiniProfiler.Mvc5.dll
  MiniProfiler.Providers.MongoDB -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.MongoDB\bin\Release\netstandard2.0\MiniProfiler.Providers.MongoDB.dll
  MiniProfiler.AspNetCore.Mvc -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore.Mvc\bin\Release\netstandard2.0\MiniProfiler.AspNetCore.Mvc.dll
  MiniProfiler.AspNetCore.Mvc -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore.Mvc\bin\Release\netstandard1.6\MiniProfiler.AspNetCore.Mvc.dll
  MiniProfiler.AspNetCore.Mvc -> C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore.Mvc\bin\Release\net461\MiniProfiler.AspNetCore.Mvc.dll
C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.RavenDB\MiniProfiler.Providers.RavenDB.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.Mvc5\MiniProfiler.Mvc5.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.EF6\MiniProfiler.EF6.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.MongoDB\MiniProfiler.Providers.MongoDB.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.Redis\MiniProfiler.Providers.Redis.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore\MiniProfiler.AspNetCore.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.EntityFrameworkCore\MiniProfiler.EntityFrameworkCore.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.AspNetCore.Mvc\MiniProfiler.AspNetCore.Mvc.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.MySql\MiniProfiler.Providers.MySql.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.Sqlite\MiniProfiler.Providers.Sqlite.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.Shared\MiniProfiler.Shared.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.SqlServerCe\MiniProfiler.Providers.SqlServerCe.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler.Providers.SqlServer\MiniProfiler.Providers.SqlServer.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\git\MiniProfiler\dotnet\src\MiniProfiler\MiniProfiler.csproj : error MSB4057: The target "GetNativeManifest" does not exist in the project.
C:\Program Files\dotnet\sdk\2.1.104\Microsoft.Common.CurrentVersion.targets(4841,5): error MSB4044: The "FindUnderPath" task was not given a value for the required parameter "Path". [C:\git\MiniProfiler\dotnet\PackageBuild.csproj]

Environment:

λ dotnet --info
.NET Command Line Tools (2.1.104)

Product Information:
 Version:            2.1.104
 Commit SHA-1 hash:  48ec687460

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17134
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.104\

Host (useful for support):
  Version: 2.1.0-preview2-26406-04
  Commit:  6833f3026b

.NET Core SDKs installed:
  1.1.7 [C:\Program Files\dotnet\sdk]
  2.0.2 [C:\Program Files\dotnet\sdk]
  2.0.3 [C:\Program Files\dotnet\sdk]
  2.1.1 [C:\Program Files\dotnet\sdk]
  2.1.2 [C:\Program Files\dotnet\sdk]
  2.1.4 [C:\Program Files\dotnet\sdk]
  2.1.100-preview-007363 [C:\Program Files\dotnet\sdk]
  2.1.100 [C:\Program Files\dotnet\sdk]
  2.1.101 [C:\Program Files\dotnet\sdk]
  2.1.102 [C:\Program Files\dotnet\sdk]
  2.1.103 [C:\Program Files\dotnet\sdk]
  2.1.104 [C:\Program Files\dotnet\sdk]
  2.1.200-preview-007474 [C:\Program Files\dotnet\sdk]
  2.1.200-preview-007517 [C:\Program Files\dotnet\sdk]
  2.1.200-preview-007576 [C:\Program Files\dotnet\sdk]
  2.1.200-preview-007589 [C:\Program Files\dotnet\sdk]
  2.1.200-preview-007597 [C:\Program Files\dotnet\sdk]
  2.1.200 [C:\Program Files\dotnet\sdk]
  2.1.201 [C:\Program Files\dotnet\sdk]
  2.1.300-preview1-008174 [C:\Program Files\dotnet\sdk]
  2.1.300-preview2-008530 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0-preview1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.0-preview2-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0-preview1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.0-preview2-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.0-preview1-26216-03 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.0-preview2-26406-04 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

I've created a branch with the repro here: https://github.com/MiniProfiler/dotnet/tree/craver/traversal

To run:

dotnet build PackageBuild.csproj -c Release /p:CI=true

I see related issues in MSBuild here:

...but I would assume (dangerous!) those downstream issues are from traversal double-includes of projects, or possible from the tree beneath a project (some of the projects in there reference others, with most of them referencing MiniProfiler.Shared at the end) not being fully evaluated on what to build? Just trying to save some time with observations here...hopefully the repro above helps more than anything.

@jeffkl
Copy link
Contributor

jeffkl commented May 30, 2018

It seems there are two unique issues here.

error MSB4057: The target "GetNativeManifest" does not exist in the project.

In newer version of MSBuild, the project-to-project call of GetNativeManifest was marked optional. I had trouble reproducing the error at first because I'm using newer versions of .NET Core and MSBuild.

I recommend that you use a newer version of .NET Core SDK in your global.json. I tried 2.1.200 and it had the fix to ignore missing targets.

If that's not an option, you'll need to specify an empty GetNativeManifest target in your Directory.Build.props so that the target exists.

  <Target Name="GetNativeManifest" />

The real one will override your empty one if its ever defined.

error MSB4044: The "FindUnderPath" task was not given a value for the required parameter "Path"

This is caused by some confusing logic in the MSBuild default targets here. It turns out that OutDir has a value as long as you don't specify a Configuration. In your case, you're specifying -c Release so OutDir isn't specified and then you get an error deep in the Clean target.

This is a bug and we'll get this fixed. I'll either disable the Clean target for traversal project since they don't really produce anything or I'll just set OutDir and OutputPath by default.

A workaround for now is to set OutputPath in your traversal project.

<Project Sdk="Microsoft.Build.Traversal/1.0.22">
  <PropertyGroup>
    <OutputPath Condition=" '$(Configuration)' != '' ">bin\$(Configuration)\</OutputPath>
    <OutputPath Condition=" '$(Configuration)' == '' ">bin\Debug\</OutputPath>
  </PropertyGroup>
  <ItemGroup>
    <ProjectReference Include="src\**\*.*proj" />
  </ItemGroup>
</Project>

@jeffkl
Copy link
Contributor

jeffkl commented May 30, 2018

The fix for the "FindUnderPath" error is available in 1.0.34. Let me know if it solves that issue.

@NickCraver
Copy link
Member Author

Confirmed the FindUserPath is resolved in .34. Now that 2.1 is out and 2.1.300 is stable I also gave that a go - no issues at all now. I need to compare outputs and such to confirm this will work but these 2 are good to go.

Thanks for the quick help @jeffkl! It's much appreciated :)

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