Bug 17430 - mono runtime reports error with nuget pack
Summary: mono runtime reports error with nuget pack
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 17007 ()
Depends on: 18859 18885 18952 18957 19088 19189 19191
Blocks:
  Show dependency tree
 
Reported: 2014-01-25 13:33 UTC by john.lon.bickel
Modified: 2018-03-15 10:39 UTC (History)
10 users (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 NOT_ON_ROADMAP

Description john.lon.bickel 2014-01-25 13:33:28 UTC
mono reports a System.NotImplementedException exception when i trying to build a nuget package.

mono nuget.exe pack Kiev.csproj -Prop Configuration=Release -Verbosity Detailed

Attempting to build package from 'Kiev.csproj'.
System.NotImplementedException: The requested feature is not implemented.
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, IDictionary`2 globalProperties, System.String toolsVersion) [0x00000] in <filename unknown>:0 
  at NuGet.Commands.ProjectFactory..ctor (System.String path, IDictionary`2 projectProperties) [0x00000] in <filename unknown>:0 
  at NuGet.Commands.PackCommand.BuildFromProjectFile (System.String path) [0x00000] in <filename unknown>:0 
  at NuGet.Commands.PackCommand.BuildPackage (System.String path) [0x00000] in <filename unknown>:0 
  at NuGet.Commands.PackCommand.ExecuteCommand () [0x00000] in <filename unknown>:0 
  at NuGet.Commands.Command.Execute () [0x00000] in <filename unknown>:0 
  at NuGet.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 


==================

Here is mono version report:

Mono JIT compiler version 3.2.6 ((no/9b58377 Thu Jan 16 17:49:56 EST 2014)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  x86
	Disabled:      none
	Misc:          softdebug 
	LLVM:          yes(3.3svn-mono-(no/8bdedb5)
	GC:            sgen
Comment 1 Mikayla Hutchinson [MSFT] 2014-02-24 16:34:58 UTC
The Microsoft.Build.Evaluation.* API is not implemented and there are no immediate plan to support it.
Comment 2 Mikayla Hutchinson [MSFT] 2014-04-07 14:12:35 UTC
*** Bug 18837 has been marked as a duplicate of this bug. ***
Comment 3 Mikayla Hutchinson [MSFT] 2014-04-07 14:13:26 UTC
*** Bug 17007 has been marked as a duplicate of this bug. ***
Comment 4 Michael Teper 2015-02-10 20:04:34 UTC
I tried a similar command today and got a slightly different output:

System.NotImplementedException: The requested feature is not implemented.
  at NuGet.Commands.ProjectFactory.ResolveTargetPath () [0x00000] in <filename unknown>:0 
  at NuGet.Commands.ProjectFactory.BuildProject () [0x00000] in <filename unknown>:0 
  at NuGet.Commands.ProjectFactory.CreateBuilder (System.String basePath) [0x00000] in <filename unknown>:0 
  at NuGet.Commands.PackCommand.BuildFromProjectFile (System.String path) [0x00000] in <filename unknown>:0 
  at NuGet.Commands.PackCommand.BuildPackage (System.String path) [0x00000] in <filename unknown>:0 
  at NuGet.Commands.PackCommand.ExecuteCommand () [0x00000] in <filename unknown>:0 
  at NuGet.Commands.Command.Execute () [0x00000] in <filename unknown>:0 
  at NuGet.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 

No reference to "Microsoft.Build.Evaluation.Project..ctor" this time. Is the problem still with MSBuild or have we moved past it?
Comment 5 Matt Ward 2015-02-11 04:00:08 UTC
@MichaelTeper - The problem is still missing features in Microsoft.Build.Evaluation. When I tested this with Mono 3.4 I had the same callstack as you are seeing with the ResolveTargetPath throwing a NotImplementedException. This was being thrown due to a call to Project.ReevaluateIfNecessary() which is not implemented and is Bug 18952.
Comment 6 Michael Teper 2015-02-11 10:57:27 UTC
Thanks, Matt. 18952 looks like a private bug. Is there a workaround, or is Mono locked out of being able to do 'nuget pack Foo.csproj' indefinitely?
Comment 7 Matt Ward 2015-02-11 11:03:55 UTC
@MichaelTeper - Right now your best bet is to use NuGet pack with a .nuspec file instead of using the project file if possible. There are various parts of Microsoft.Build.Evaluation that are not currently implemented in Mono and as far as I am aware there is no immediate plan to implement the missing parts.
Comment 8 Michael Teper 2015-02-11 11:59:42 UTC
Matt, I am not sure what their plans are, but would this become easier or go away as a problem if MS were to OSS MSBuild?

In my case, we are contributing to a project and don't own the .nuspec file.
Comment 9 Matt Ward 2015-02-11 12:05:12 UTC
If Microsoft opened sourced MSBuild with a compatible license I expect it would be integrated into Mono which would fix the NuGet pack problem.
Comment 10 hansk 2015-04-21 17:48:57 UTC
Matt, that happened: http://blogs.msdn.com/b/dotnet/archive/2015/03/18/msbuild-engine-is-now-open-source-on-github.aspx

Where would be the best place to monitor progress (if any) on that effort?
Comment 11 Matt Ward 2015-04-22 04:04:52 UTC
There is a public Trello board where the status of integrating the open sourced parts of .NET Framework into Mono is tracked:

https://trello.com/b/vRPTMfdz/net-framework-integration-into-mono

Currently MSBuild does not seem to be listed on this Trello board. However there has been some initial investigation into using the open sourced MSBuild, for example - https://twitter.com/slluis/status/581475601565028352
Comment 12 Marek Safar 2018-03-15 10:39:59 UTC
We deprecated xbuild and recommend using msbuild instead. Switching to msbuild will also most likely resolve the issue you reported.