I have noticed that when I publish the new ASP.NET project, then it puts all the non-code files in the root folder in packages. E.g. these files end up there:
There is no real need to include those in the published folder. In older solutions it was just as easy as modifying properties of the files to exclude them. Now properties do something completely different and open a quite useless dialog where you can only see the path of the file. Perhaps it's possible to do some other way? Ideally the IDE should be smart enough not to publish these common files, but for some custom it should be a way to exclude them.
It's of course not so big of a problem that some additional files get published, but it makes sense to exclude them as well.
P.S. The possible proposed duplicate is not the same, since it deals only with the old project/solution structure, while ASP.NET Core introduced a new one where the other solution is not applicable.
By default all code files in a directory containing a project.json are included in the project. You can control this with the include/exclude sections of the project.json.
The most common sections that you will see for including and excluding files are:
{
"compile": "*.cs",
"exclude": [
"node_modules",
"bower_components"
],
"publishExclude": [
"**.xproj",
"**.user",
"**.vspscc"
]
}
From here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With