Search code examples
asp.net-coreasp.net-core-mvcdnxdnu

dnu publish adds 2 packages folders to the output result


I am using dnu publish command but I have noticed that the output contains 2 packages folders as follow:

1 - approot\packages

2 - approot\src\"project name"\packages

Now one difference between the two folders is that folder # 1 contains only packages that matches the target framework so the size is really small whereas as folder # 2 contains everything for every package, thats why the size is too big. For example folder # 1 has a size of 11 MB whereas # 2 has a size of 120 MB.

I don't think IIS will be using folder # 2 but I don't know why it is been created in the first place.

Also I noticed that folder # 2 is also get created in Visual Studio.

I am on this version now: dnx-clr-win-x64.1.0.0-beta7

I know packages are downloaded to C:\Users\.dnx\packages so why would Visual Studio 2015 also including it in the project?


Solution

  • Use --no-source switch as this one does not produce src folder at all.

    Like this: dnu publish --no-source

    EDIT: (sorry missed second part of the question) As I understand dnu publish includes all packages in publish package to create self contained package. This way of doing things ease deployment. You may also decide to deliver whole runtime as a package and have zero external dependencies on any installed or not tools on server.