Search code examples
nuget-packagepaket

Create package that references another package in solution


I often have this situation:

Foo.sln
    Foo.csproj
    Foo.Wpf.csproj

Then I create:

  • A nuget package Foo.nupkg
  • A package for Foo.Wpf.nupkg referencing Foo.nupkg.

I could not find out how to specify that dependency in the docs.


Solution

  • Just create a paket.template for each project and make sure you set the "type" property to "project". Paket will figure things out automatically for you

    Edit:

    Sample:

    Foo.sln
        Foo.csproj
            paket.template
        Foo.Wpf.csproj
            paket.template
    

    Where the paket.template files looks like this:

    type project
    // This assumes that Author and Version are specified in the project.
    

    If you want to override the defaults check out the docs