How do I create a package that depends on a package that "targets projects"?
Asked Answered
P

1

6

I am trying to create a chocolatey package. I initially created a version that did not have any dependencies and I simply put an exe file in the tools/bin directory and then made a simple nuspec file, and this correctly would install the exe file to the path, which is all I need for this internal tool.

However, the project has now been restructured so that it depends on an external dependency. The dependency is a nuget package which is in the same repository as the main project. To add the dependency, I added it to the dependencies section. The project itself in Visual Studio is also dependent on the same. Here is my nuspec file: (I removed some data, marked by rm, but it should not affect it. Everything else is the same)

<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesnt appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
   <metadata>
      <!-- Read this before publishing packages to chocolatey.org: https://github.com/chocolatey/chocolatey/wiki/CreatePackages -->
      <id>lisp-translator</id>
      <title>lisp-translator (Install)</title>
      <version>0.1.0</version>
      <authors>rm</authors>
      <owners>rm</owners>
      <summary>rm</summary>
      <description>rm</description>
      <projectUrl>rm</projectUrl>
      <tags>lisp-translator admin</tags>
      <copyright />
      <licenseUrl>rm</licenseUrl>
      <requireLicenseAcceptance>false</requireLicenseAcceptance>
      <!--<iconUrl>http://cdn.rawgit.com/__REPLACE_YOUR_REPO__/master/icons/lisp-translator.png</iconUrl>-->
      <dependencies>
         <dependency id="LispParsingLibrary" version="1.1.0.17190" />
      </dependencies>
      <releaseNotes />
   </metadata>
</package>

However, when I try to install it, I get a rather esoteric error:

lisp-translator not installed. An error occurred during installation:
 External packages cannot depend on packages that target projects.
The install of lisp-translator was NOT successful.
lisp-translator not installed. An error occurred during installation:
 External packages cannot depend on packages that target projects.

Chocolatey installed 0/1 package(s). 1 package(s) failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures:
 - lisp-translator

What am I doing wrong regarding adding of this dependency?

Philology answered 21/5, 2015 at 20:8 Comment(0)
A
1

That's a really old, dumb nuget packaging issue. The package LispParsingLibrary has a folder called "content" in it. Which means that your package also would need a content folder in it.

We don't recommend that at all. Please ask the maintainer of the LispParsingLibrary to remove that folder or create it on install and copy files into it.

I thought we had an issue filed to track this, but I added https://github.com/chocolatey/choco/issues/290

Acaleph answered 22/5, 2015 at 20:20 Comment(3)
A related question is #24711318Acaleph
LispParsingLibrary doesn't seem to have a content folder. E.g., opening it in NuGet Package Explorer shows only a lib/net45 folder with the dll and no content folder.Philology
@Philology where does one find this LispParsingLibrary package? I don't see it on Nuget or Chocolatey.Acaleph

© 2022 - 2024 — McMap. All rights reserved.