Sdk: dotnet pack Sequence contains no elements

Created on 5 Mar 2016  路  3Comments  路  Source: dotnet/sdk

I am trying to (ab)use dotnet to create a package that contains only native libs. My project.json is therefore minimal and looks like this:

{
  "version": "0.1.0-*",
  "description": "libuv build package - Windows",
  "author": "Microsoft",

  "packInclude": {
    "runtimes/win7-x86/native": "bin/Win32/libuv.dll",
    "runtimes/win7-x64/native": "bin/x64/libuv.dll",
    "runtimes/win7-arm/native": "bin/ARM/libuv.dll",  
  }
}

Trying to create a package:

>dotnet pack --no-build
Sequence contains no elements

Not sure if it is a separate issue but I could not get more details (e.g. stacktrace) using the -v flag.

>dotnet -v pack
Sequence contains no elements

> dotnet pack -v
Specify --help for a list of available options and commands.
Unrecognized option '-v'

Most helpful comment

I was having the same issue. For me, nuget was getting confused between versions of System.Net.Http.

Original:

{
  "dependencies": {
    "System.Net.Http": "4.1.0",
    "Newtonsoft.Json": "9.0.1"
  },
  "frameworks": {
    "netstandard1.5": {
      "imports": [
        "dnxcore50"
      ],
      "dependencies": {
      }
    },
    "net46": {
      "frameworkAssemblies": {
        "System.Net.Http.WebRequest": "4.0.0.0"
      }
    }
  }
}

Resolved:

{
  "dependencies": {
    "Newtonsoft.Json": "9.0.1"
  },
  "frameworks": {
    "netstandard1.5": {
      "imports": [
        "dnxcore50"
      ],
      "dependencies": {
         "System.Net.Http": "4.1.0",
      }
    },
    "net46": {
      "frameworkAssemblies": {
        "System.Net.Http": "4.0.0.0",
        "System.Net.Http.WebRequest": "4.0.0.0"
      }
    }
  }
}

This was very difficult to figure out as _dotnet build_ didn't have any issues only _dotnet pack_ and the error was very cryptic _Sequence contains no elements_.

All 3 comments

Same error with dotnet pack

{
  "version": "1.0.1",

  "dependencies": {
    "Microsoft.AspNet.WebApi.Client": "5.2.3",
    "System.Net.Http": "4.1.0"
  },

  "frameworks": {
    "net46": {}
  }
}

NuGet will output

Attempting to build package from 'SharedEmailEntities.nuspec'.
Value cannot be null or an empty string.
Parameter name: value

Worked when I changed to

{
  "version": "1.0.1",

  "dependencies": {
    "Microsoft.AspNet.WebApi.Client": "5.2.3"
  },
  "frameworkAssemblies": {
    "System.Net.Http": "4.0.0.0"
  },
  "frameworks": {
    "net46": {
      "imports": "dnxcore50"
    }
  }
}

I was having the same issue. For me, nuget was getting confused between versions of System.Net.Http.

Original:

{
  "dependencies": {
    "System.Net.Http": "4.1.0",
    "Newtonsoft.Json": "9.0.1"
  },
  "frameworks": {
    "netstandard1.5": {
      "imports": [
        "dnxcore50"
      ],
      "dependencies": {
      }
    },
    "net46": {
      "frameworkAssemblies": {
        "System.Net.Http.WebRequest": "4.0.0.0"
      }
    }
  }
}

Resolved:

{
  "dependencies": {
    "Newtonsoft.Json": "9.0.1"
  },
  "frameworks": {
    "netstandard1.5": {
      "imports": [
        "dnxcore50"
      ],
      "dependencies": {
         "System.Net.Http": "4.1.0",
      }
    },
    "net46": {
      "frameworkAssemblies": {
        "System.Net.Http": "4.0.0.0",
        "System.Net.Http.WebRequest": "4.0.0.0"
      }
    }
  }
}

This was very difficult to figure out as _dotnet build_ didn't have any issues only _dotnet pack_ and the error was very cryptic _Sequence contains no elements_.

Closing as dotnet pack became a proxy for nuget pack in preview3.

/CC @rrelyea

Was this page helpful?
0 / 5 - 0 ratings