Bug 57463 - NuGet "Pack" target in msbuild does not exist
Summary: NuGet "Pack" target in msbuild does not exist
Status: RESOLVED FIXED
Alias: None
Product: Tools
Classification: Mono
Component: msbuild ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Ankit Jain
URL:
Depends on:
Blocks:
 
Reported: 2017-06-13 22:32 UTC by Connie
Modified: 2017-07-25 00:23 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Connie 2017-06-13 22:32:48 UTC
I am trying to use the mono tools to compile a .NET Standard library. I can use the NuGet targets `/t:Restore` and build the project, however, when I execute `msbuild /t:Pack hello.csproj`, I get the following error:

/root/hello/hello.csproj : error MSB4057: The target "pack" does not exist in the project.

From the NuGet documentation (https://docs.microsoft.com/en-us/nuget/schema/msbuild-targets), these targets should be in MSBuild 15.1+.  The version shipped with 5.2.0 is 15.2, I am not sure why it is missing?

OS: Ubuntu 16.04
Mono Version: 5.2.0 Preview 1 (5.2.0.104) - Alpha

Repro Steps:
1. Install Mono (Alpha)
2. Install .NET Core (https://www.microsoft.com/net/core#linuxubuntu)
3. sudo apt-get install tzdata  (I had to do this because I had a FileNotFoundException for /etc/localtime.)
4. mkdir hello
5. cd hello
6. dotnet new library
7. msbuild /t:restore hello.csproj
8. msbuild hello.csproj
9. msbuild /t:pack hello.csproj

Expected: 
It creates a NuGet package for hello.csproj.

Actual:

root@d3e6c1b70514:~/hello# msbuild /t:pack hello.csproj
Microsoft (R) Build Engine version 15.2.0.0 ( Thu May 11 17:28:41 UTC 2017)
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 06/13/2017 22:29:53.
Project "/root/hello/hello.csproj" on node 1 (pack target(s)).
/root/hello/hello.csproj : error MSB4057: The target "pack" does not exist in the project.
Done Building Project "/root/hello/hello.csproj" (pack target(s)) -- FAILED.

Build FAILED.

"/root/hello/hello.csproj" (pack target) (1) ->
  /root/hello/hello.csproj : error MSB4057: The target "pack" does not exist in the project.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.62
root@d3e6c1b70514:~/hello#
Comment 1 Ankit Jain 2017-06-27 05:41:54 UTC
Added on xplat-master and d15.3 . https://github.com/mono/msbuild/commit/4148902fc95fb8dc59437dcdb3e24c97f6dcf663
Comment 2 Connie 2017-07-25 00:23:37 UTC
Is there a release timeline for 15.3 I could follow?