asp.net core 2.0 publish generating lots off DLL

Frantisek Pastorek picture Frantisek Pastorek · Jul 24, 2018 · Viewed 7.1k times · Source

A programming one application few months and everytime when i published my project, tis generated 19 items (without wwwroot files). And from today, its generating 202 files with lots of .dll (without wwwroot files). I have no idea what happend or what i did. My application using .NET Core 2.0. I dont know what information about my project is relevant. Aproximately 81/202 files are only Microsoft.AspNetCore libraries and 43/202 are only Microsoft.Extensions libraries. I tried deleted obj, bin, properties and node_modules and still same problem. After upload only files what its generated before from lots of files, everything worked. I think its not necessary .dll but i have no idea why asp.net still generating them. Thank you for any advice.

EDIT:

Here is one big screenshot of publish output, dependencies and output of publish added by request from one of users who commented this question: enter image description here

EDIT:

I got new error after change publish properties from Self-contained deployments to Framework-dependent deployments and i get new error from output:

C:\Program Files\dotnet\sdk\2.1.400-preview-009063\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(125,5): Error NETSDK1068: The framework-dependent application host requires a target framework of at least 'netcoreapp2.1'.

EDIT:

Now i tried create new project asp.net core 2.0 and tried published. Same problem. Something is wrong with my sdk or i dont know.

SOLUTION:

I created new project with target 2.1 and move all source files. After resolve few error everything working fine.

Answer

SausageFingers picture SausageFingers · Jan 10, 2019

This is caused by a bug introduced in .NET Core SDK version 2.1.400. See Framework Dependent Publish doesn't work on 2.1.400 #9852

There is a workaround - publish via the command line and pass the arg --self-contained false.

Example:

dotnet publish -f netcoreapp2.0 -c Release --self-contained false