Skip to content

Where is the Package.config file gone?

R.I.P.
I just updated to the latest VisualStudio 2017 RC, .Net Core 1.1.1 and worked on a previously started little ASP.Net Core app. I’ve managed Nuget packages for the app by adding and removing packages. When it came to commit my changes I thought the version control must be broken: no changes made to the package.config file each .Net developer got so used to over the last years.

After a while I took a closer look at the issue. The package.config does not exist anymore. But the .csproj file exists again (no project.json anymore) and its format changed. It’s short, really short and no GUID’s in anymore. And hey: here we go – there are the packages, right within the .csproj! Here is a complete .csproj:

<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
  <PropertyGroup>
    <TargetFramework>netstandard1.6</TargetFramework>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <OutputType>library</OutputType>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.0" />
    <PackageReference Include="NETStandard.Library" Version="1.6.1" />
    <PackageReference Include="System.ComponentModel.Annotations" Version="4.3.0" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore">
      <HintPath>..\..\..\..\..\..\Users\marc.duerst\.nuget\packages\microsoft.aspnetcore.identity.entityframeworkcore\1.1.0\lib\netstandard1.3\Microsoft.AspNetCore.Identity.EntityFrameworkCore.dll</HintPath>
    </Reference>
    <Reference Include="System">
      <HintPath>..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.dll</HintPath>
    </Reference>
  </ItemGroup>
</Project>

See the PackageReferences? So nice and clean. Not only 3rd party packages are in there but also the NetStandard library itself. I also remembered I read about this change a while ago. Microsoft re-invented the .csproj files and dropped the project.json files introduced with .Net Core 1. More infos here

R.I.P. package.config !

marcd View All

I love to write software. More then two decades ago I managed to make my hobby my full-time job so I spent more then 20 year writing professional software (I guess that makes me a "Senior Software Developer"). The last few years I spend most of the time developing in C#/.Net for all kind of windows-, web- and embedded-software.

In my free time I enjoy my family, taking photos and go diving in cold lakes and rivers in Switzerland.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s