Quantcast
Channel: WE MOVED to github.com/nuget. This site is not monitored!
Viewing all articles
Browse latest Browse all 7612

Commented Unassigned: [NuGet 2.7] New package restore doesn't work on Mono when using SLN file [3596]

$
0
0
The new package restore workflow doesn't work on Mono when using an SLN file, i.e. invoking
```nuget.exe -restore MySolution.sln```

returns: "An exception was thrown by the type initializer for NuGet.Common.Solution"

After digging into the source code (specifically [Solution.cs](https://nuget.codeplex.com/SourceControl/latest#src/CommandLine/Common/Solution.cs)), it turns out that NuGet uses an internal MSBuild class for parsing SLN files, ```Microsoft.Build.Construction.SolutionParser```, which is not available on Mono.

It appears that NuGet only needs to parse the SLN to find paths to project-level packages.config files, which IMHO shouldn't require relying on invoking an internal class via reflection.

Restoring packages by specifying the packages.config file works fine on Mono.

___
Ubuntu Server 12.10
Mono 3.1
NuGet 2.7RC
Comments: I've spent some time on this and got it working on Mono by parsing the relevant pieces of the SLN myself via a Regex: https://nuget.codeplex.com/SourceControl/network/forks/akoeplinger/NewPackageRestoreOnMono/changeset/b3726a4a79e033d828063671d4ebfae074ecf324 Is this something that could be considered for a PR ?

Viewing all articles
Browse latest Browse all 7612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>