Rasmus Bækgaard
Rasmus Bækgaard

Reputation: 749

No /bin-folder on asp.net core publish

I made a small ASP.NET Core (2.0) project, which I thought would output files the same way the old ASP.NET 5 would - but apparently not.

In the old days I would get a web.config, a bin/ with my .dlls, and what else I needed when I deployed to my server.

With the new project I still get a web.config, but all of my dependencies is laying right next to it.

I tried changing the /p:WebPublishMethod from FileSystem to Package, and MSDeploy but still no /bin-folder for me.

How come all my files are in the root of my publish folder?

Upvotes: 11

Views: 9235

Answers (2)

user1961169
user1961169

Reputation: 799

I'm just switching a website over to VS2019 from VS2017, and having the same issue. I discovered that VS2019 has totally new publish settings, and these don't seem to be initialised properly when coming over from VS2017. Instead of precompiling, the publish happens with all the .aspx.cs files not compiled.

To fix it, follow these steps...

  • Under Build, Publish Web App, once you have setup the folder profile to publish to, in the summary section, there is a Configuration setting. Click on the Pencil icon on the "Configuration Line".
  • This will show Publish Settings
  • Open up the File Publish Options
  • Turn on "Precompile during publishing"
  • Save the settings and click on "Publish"

Now it's like it was in VS2017, with a bin directory of dll files.

Upvotes: 0

poke
poke

Reputation: 388023

Publishing an ASP.NET Core project will create an output structure that can be deployed as it is. The output format is suitable for self-hosting and to be hosted through IIS.

There is no bin folder simply because there does not need to be one. It’s the published output, not just intermediary build output. All the files within the publish directory are required to host your application.

Upvotes: 9

Related Questions