Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 653
Rasmus Bækgaard Avatar asked Feb 18 '18 00:02

Rasmus Bækgaard


People also ask

Why bin folder is not created?

It's probably likely that there is an issue with dotnet on your path variable. Go to your system variables and add C:\Program Files\dotnet\ to path. It should fix the issue if you had the same problem as me.

How can add wwwroot folder in asp net core API?

In order to add the wwwroot folder, right-click on the project and then select add => new folder option and then provide the folder name as wwwroot.

What is bin folder in asp net?

The Bin folder is used for managed-code assemblies, not for native-code (unmanaged-code) assemblies. For more information, see Loading C++ Assemblies in ASP.Net. In ASP.NET 2.0 and later versions, you can put strong-named (signed) assemblies in the Bin folder.

How to publish ASP NET Core web app to a local folder?

With Visual Studio Publish Tool, we can easily deploy our .NET Core app to different targets. In this article, we published ASP.NET Core Web App to a Local Folder. After we choose the publishing method, we can set various settings such as Deployment mode, Configuration, and Target runtime.

How are publish items computed in ASP NET Core?

The publish items are computed (the files that are needed to publish). The project is published (the computed files are copied to the publish destination). When an ASP.NET Core project references Microsoft.NET.Sdk.Web in the project file, an app_offline.htm file is placed at the root of the web app directory.

Is there a bin folder in the publish directory?

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.

How to publish an app to a folder in IIS?

The app is published to a folder. The folder's contents are moved to the IIS site's folder (the Physical path to the site in IIS Manager). Right-click on the project in Solution Explorer and select Publish. In the Pick a publish target dialog, select the Folder publish option. Set the Folder or File Share path.


Video Answer


1 Answers

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.

like image 143
poke Avatar answered Sep 21 '22 09:09

poke