2

I just setup a private/local nuget gallery. I created my first package using the instructions mentioned in http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package

However I am getting the following error when i try to upload my package:

The package manifest contains an invalid Target Framework: ''

Any ideas?

[EDIT]

This is the nuspec file content within the package:

<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
  <metadata>
    <id>EpsiDB</id>
    <version>1.0.0.0</version>
    <title>EpsiDB</title>
    <authors>Microsoft</authors>
    <owners>Microsoft</owners>
    <licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl>
    <projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl>
    <iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>This is a test package</description>
    <releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
    <copyright>Copyright 2014</copyright>
    <tags>Tag1 Tag2</tags>
    <dependencies>
      <dependency id="AntiXSS" version="4.2.1" />
      <dependency id="EntityFramework" version="6.0.2" />
      <dependency id="odp.net.managed" version="121.1.1" />
      <dependency id="odp.net.x64" version="112.3.20" />
      <dependency id="odp.net.x86" version="112.3.20" />
    </dependencies>
  </metadata>

This is the source code and what it is going wrong:

enter image description here

Aidin
  • 2,134
  • 22
  • 26
  • What is contained in the nuget package? Any assemblies? What framework are they supposed to be targeted at? – Steven V Jan 24 '14 at 15:36
  • The package is built from a simple library project targeting .NET 4.5. Project contains 3 simple classes and references the following nuget packages: AntiXSSLibrary, EntityFramework, Oracle.DataAccess, Oracle.ManagedDataAccess. The package itself has the following folders: _rels, lib, and package. the lib folder contains only net45 folder within it is only the main project assembly – Aidin Jan 24 '14 at 15:41
  • Ironically, [one of the Stack Overflow/Stack Exchange developers had this exact issue](https://twitter.com/kevinmontrose/status/418968735123537921) with the public nuget.org repository three weeks ago. And looks like a nuget.org representative fixed it there. Possible the fix hasn't made it through to the open source `Nuget.Server` package? – Steven V Jan 24 '14 at 15:48
  • Ha, I just figured out that you're probably the guy that is the most recent tweet in that thread. Sorry about that! – Steven V Jan 24 '14 at 16:16

2 Answers2

2

The problem was because of a bug in the source code. I communicated with Nuget core team and it was confirmed as a recently introduced bug which was fixed but not pushed at the time. Per grenade suggestion, I could publish my packages through Nuget.exe and I could avoid this problem altogether (because Nuget.exe wasn't built from the problematic code). However, that was not an option for me because I needed to fix the UI so other users could take advantage of the UI.

I fixed the problem myself in the Nuget source code. It was more like a serialization problem. I am sure as of now it has been fixed in the source code by the Nuget core team.

Kudos to Microsoft Nuget team for amazing support and responsiveness.

Aidin
  • 2,134
  • 22
  • 26
  • 1
    From the twitter conversation, the fix is in https://github.com/NuGet/NuGetGallery/commit/284e6401115ebf7f471aa1cd8b137dabc1ffbb20 – maddoxej Mar 07 '14 at 17:42
0

I ran into the same issue with a local NuGetGallery. I work around this by publishing from the command line (which accepts the push without an error). Eg:

NuGet.exe push <my-package>.nupkg <my-api-key> -s http://<local-nuget-server>
grenade
  • 31,451
  • 23
  • 97
  • 126