Question

Octopack fails to build with the following xml

<?xml version="1.0"?>
<package >
  <metadata>
    <id>WebCrawlerMVC</id>
    <version>1.0.0.0</version>
    <title>Web Crawler</title>
    <authors>lardern</authors>
    <owners>Nostrum Group</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>packaging webcrawler mvc</description>
    <releaseNotes>no release notes</releaseNotes>
    <copyright>Copyright 2013</copyright>
  </metadata>
   <dependencies>
        <dependency id="Ninject" version="3.0.1.10" />
        <dependency id="HtmlAgilityPackHelpers" />
    </dependencies>
    <files src="C:\Users\lardern\Documents\Visual Studio 2010\Projects\WebCrawlerMVC\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll"/>
    <files src="C:\Users\lardern\Documents\Visual Studio 2010\Projects\HtmlAgilityPack\HtmlAgilityPack\HtmlAgilityPackHelpers\bin\Release\HtmlAgilityPackHelpers.dll" />
</package>

the error i receive is

Error 2 The command ""C:\Users\lardern\Documents\Visual Studio 2010\Projects\WebCrawlerMVC\WebCrawlerMVC..\packages\OctoPack.1.0.111\tools\NuGet.exe" pack "C:\Users\lardern\Documents\Visual Studio 2010\Projects\WebCrawlerMVC\WebCrawlerMVC\WebCrawlerMVC.nuspec" -OutputDirectory "bin" -basePath "C:\Users\lardern\Documents\Visual Studio 2010\Projects\WebCrawlerMVC\WebCrawlerMVC" -Version "1.0.0.0" -NoPackageAnalysis" exited with code 1. WebCrawlerMVC

I'm not quite sure what this means, if I don't have the dependencies added, it builds in release fine otherwise it comes back with this error.

Edit: I edited the code above, thanks for spotting the mistake adam, but the error still occurs. Also took out each dependency to see if one was causing the error, failed both times.

Was it helpful?

Solution

If you view your full build log, you should be able to find more information than just the error line above - NuGet.exe is probably complaining about them.

However, Octopus packages should not include dependencies anyway.

Another NuGet feature that doesn't translate well to Octopus is dependencies. NuGet has a convenient feature for tracking dependencies between packages. This is used when, for example, a package like NHibernate depends on a package like log4net. NuGet will install NHibernate, resolve the dependency, and install log4net. It's important to note that NuGet will install them to two separate folders on disk:

packages/NHibernate.x.y.z
packages/log4net.x.y.z

While this makes sense for libraries referenced via Visual Studio, it doesn't make sense in Octopus, for the same reasons as above. For example, if your Octopus application package had a dependency on log4net, on disk you would have:

packages/YourApp.x.y.z  
packages/log4net.x.y.z

At runtime, the executables or ASP.NET site under YourApp would try to invoke a method in log4net, and fail because the DLL can't be found. While this could theoretically be solved using probing paths in your configuration file, in practice it's better to avoid this approach.

For this reason, Octopus NuGet packages cannot have dependencies.

Instead, any libraries you need to use should be bundled inside of your package in the standard binaries folder

OTHER TIPS

It looks like there is a > missing at the end of the second to last line. 8)

Edit: ok, maybe it wasn't that. But I found this link describing a problem with a space in the path.

Maybe that is relevant?

https://docs.nuget.org/create/nuspec-reference#specifying-dependencies

The dependencies element is a child element of the metadata element

I suppose it is why you had the error while running nuget pack

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top