External packages cannot depend on packages that target projects.

Apr 11, 2011 at 10:20 PM

One of the NuGet packages that I have created for our project gives me the following error when I try to install it

Install-Package : External packages cannot depend on packages that target projects.
At line:1 char:16
+ Install-Package <<<<  Nancy.ViewEngines.Razor
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

The nuspec file is called nancy.viewengines.razor.nuspec looks like the following

<?xml version="1.0"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
    <authors>Andreas H&#229;kansson and contributors</authors>
    <description>Enables using the Razor view engine with nancy</description>
    <summary>Nancy is a lightweight web framework for the .Net platform, inspired by Sinatra. Nancy aim at delivering a low ceremony approach to building light, fast web applications.</summary>
      <dependency id="Nancy" version="0.5.0" />

The package structure looks like


The package is live on nuget atm if anyone cares to take a look http://nuget.org/List/Packages/Nancy.Viewengines.Razor

Google brought up some other issues that gave this error, but as far as I could tell, non of them applies to this case.

Please advice.



Apr 12, 2011 at 9:14 AM

If I break open the package I can see that it does not contain a lib folder, even though it's in the nuget before I package it up. It has the same structure as my other 8 nugets and the other 8 works just fine =/

Apr 12, 2011 at 9:18 AM

I figured it out. There problem was that I had accidentally places my license.txt and .nuspec files inside the lib folder instead of next to it

Apr 14, 2011 at 5:22 AM

Nice :). When you build a package from the command line, you can use -verbose to see what ends up in there. Alternatively, if you want to view the contents after the package is built, you can use package explorer.