r3plica
r3plica

Reputation: 13367

VS 2015 publish website creates loads of DLLs

Something strange is happening recently. I have one project which is a SPA and when I publish it, it copies all wwwroot to the host (along with a bin folder with AspNet.dll in it). My latest project publishes a load of DLLs:

enter image description here

And then the wwwroot folder with my static files. This seems to cause issues (as the site regularly freezes when we visit it). If I clear the files from the FTP and then copy the contents of the wwwroot, it works.

Does anyone know why this is happening and how to fix it?

Upvotes: 0

Views: 383

Answers (1)

Kushan
Kushan

Reputation: 1270

This is an asp.net core application. Asp.net core is not like the full .net framework whereby the .dll files can be assumed to be on the host system, so instead it has to copy all of the files that make up asp.net core as part of a deployment (there is a way of telling it to use the "local" install of asp.net core, but that's not really relevant here, unless that's what you intended to do). That's what you're seeing here - those DLL files are required and necessary for your application to run correctly. Deleting them is a bad idea.

If you feel it's copying DLL's you're not actually using, you need to check your references and ensure none of them are referencing those in your folder.

You don't want those DLL files in your wwwroot folder, that can cause a security risk. This is correct behaviour. If you look at the web.config file present, for an ASP.net core application it'll simply direct IIS to your asp.net project (which you haven't included in your screenshot). Your project will then take over loading of those DLLs and performing how you've configured in your startup.cs class.

This seems to cause issues (as the site regularly freezes when we visit it).

You're making a rather large assumption. If you're building an asp.net core project, you should expect to see those DLL files. If you simply want to serve static HTML/CSS/JS files, you don't need an asp.net project to do that, core or otherwise - IIS would be all you need.

Do you have logs of your site? Do you have any additional information on why it's freezing? Stack traces? Event logs?

Upvotes: 1

Related Questions