Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

packages.config: Null or empty package id

I'm trying to enter my Package Manager Console, and it's giving me the following error:

An error occurred while reading file 'C:\Users\rein.shope\Documents\Visual Studio 2015\Projects\Vidly\Vidly\packages.config': Null or empty package id

The error is displayed both in a ribbon on top of the window (with a "Restore" button that does nothing on click) and in red text within the window. The console will not allow me to input commands.

Contents of packages.config:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package Id="Antlr" version="3.4.1.9004" targetFramework="net452" />
  <package Id="bootstrap" version="3.0.0" targetFramework="net452" />
  <package Id="EntityFramework" version="6.1.3" targetFramework="net452" />
  <package Id="jQuery" version="1.10.2" targetFramework="net452" />
  <package Id="jQuery.ValIdation" version="1.11.1" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.Agent.Intercept" version="1.2.1" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.DependencyCollector" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.JavaScript" version="0.22.9-build00167" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.PerfCounterCollector" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.Web" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.WindowsServer" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Identity.Owin" version="2.2.1" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net452" />
  <package Id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" />
  <package Id="Microsoft.CodeDom.ProvIders.DotNetCompilerPlatform" version="1.0.0" targetFramework="net452" />
  <package Id="Microsoft.jQuery.Unobtrusive.ValIdation" version="3.2.3" targetFramework="net452" />
  <package Id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net452" developmentDependency="true" />
  <package Id="Microsoft.Owin" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.Facebook" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.Google" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.MicrosoftAccount" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.Twitter" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
  <package Id="Modernizr" version="2.6.2" targetFramework="net452" />
  <package Id="Newtonsoft.Json" version="6.0.4" targetFramework="net452" />
  <package Id="Owin" version="1.0" targetFramework="net452" />
  <package Id="Respond" version="1.2.0" targetFramework="net452" />
  <package Id="WebGrease" version="1.5.2" targetFramework="net452" />
</packages>

All of the Id fields seem to be intact. A Google search returns nothing for "null or empty package id".

like image 760
Rein S Avatar asked Oct 14 '16 21:10

Rein S


People also ask

What is package config?

The packages. config file is used in some project types to maintain the list of packages referenced by the project. This allows NuGet to easily restore the project's dependencies when the project is to be transported to a different machine, such as a build server, without all those packages.

What is package config Targetframework?

packages. config: The targetframework attribute of a dependency specifies the variant of a package to install.

How do I convert PackageReference to packages config?

Go to Tools ->Options- > Nuget Package Manager and change the Default package management format to “PackageReference“, we have two options there- Packages. config and PackageReference. Once the format is change to PackageReference, you can go to the project which you want to migrate and click on packages. config.

Where is package config file located?

By default, pkg-config looks in the directory prefix/lib/pkgconfig for these files; it will also look in the colon-separated (on Windows, semicolon-separated) list of directories specified by the PKG_CONFIG_PATH environment variable.

What is the use of package config in NuGet?

This allows NuGet to easily restore the project's dependencies when the project to be transported to a different machine, such as a build server, without all those packages. If used, packages.config is typically located in a project root.

Where is the package config file located?

If used, packages.config is typically located in a project root. It's automatically created when the first NuGet operation is run, but can also be created manually before running any commands such as nuget restore. Projects that use PackageReference do not use packages.config.

How do I create a package in NuGet package manager?

Open the Package Manager Console using the Tools > NuGet Package Manager > Package Manager Console menu command. Once the migration is complete, we recommend that you add a reference to the nuget.build.tasks.pack nuget package, and then use msbuild -t:pack to create the package.

How many dependencies are there in the package config?

The following packages.config refers to two dependencies: The following packages.config refers to nine packages, but Microsoft.Net.Compilers will not be included when building the consuming package because of the developmentDependency attribute.


1 Answers

Try to change all Id to id (lower case). It solved for me.

like image 170
ltiveron Avatar answered Sep 26 '22 02:09

ltiveron