Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get bin folder in ASP.NET Core 1.0

Tags:

With asp.net core 1.0 There are lots of functionality added. But there is not way to get Bin Folder path.

Can anyone please know how we can get the bin folder path for asp.net core 1.0 application.

like image 394
Jalpesh Vadgama Avatar asked Feb 20 '16 18:02

Jalpesh Vadgama


People also ask

How to get bin folder path in asp net?

In asp.net RelativeSearchPath contains actual "bin" folder and in console app this is null and BaseDirectory contains actual "bin" path.

What is the bin folder 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.

Where is the Wwwroot folder in asp net core?

The path of the wwwroot folder is accessed using the interfaces IHostingEnvironment (. Net Core 2.0) and IWebHostEnvironment (. Net Core 3.0) in ASP.Net Core. The IHostingEnvironment is an interface for .

Where are .NET core files stored?

By default, the wwwroot folder in the ASP.NET Core project is treated as a web root folder. Static files can be stored in any folder under the web root and accessed with a relative path to that root.


1 Answers

Alternative way (corresponds to the AppDomain.BaseDirectory):

AppContext.BaseDirectory 
like image 86
Rolf Kristensen Avatar answered Sep 19 '22 18:09

Rolf Kristensen