You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
abp/src/AbpDesk/AbpDesk.Web.Mvc/Startup.cs

51 lines
1.6 KiB

using System.IO;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Serilog;
using Volo.Abp.Modularity.PlugIns;
namespace AbpDesk.Web.Mvc
{
public class Startup
{
private readonly IHostingEnvironment _env;
public Startup(IHostingEnvironment env)
{
_env = env;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpDeskWebMvcModule>(options =>
{
/* @halil: I added Abp.MongoDb package as a dependency to the main application in order to use the blog plugin.
* Otherwise, we should add all dependencies (Recursively) into plugin folder
* and load in correct order. We should carefully think on that problem in the future.
*/
options.PlugInSources.AddFolder(
Path.Combine(
_env.ContentRootPath,
@"../Web_PlugIns/")
);
});
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory
.AddConsole()
.AddDebug()
.AddSerilog(new LoggerConfiguration()
.Enrich.FromLogContext()
.WriteTo.RollingFile("Logs/logs.txt")
.CreateLogger()
);
app.InitializeApplication();
}
}
}