Browse Source

Resolve #1269 Make web projects InProcess for AspNetCoreHostingModel .

pull/1277/head
maliming 7 years ago
parent
commit
50d1d68165
  1. 8
      docs/en/Getting-Started-AspNetCore-Application.md
  2. 8
      docs/zh-Hans/Getting-Started-AspNetCore-Application.md
  3. 63
      framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/InProcess/CurrentDirectoryHelpers.cs
  4. 4
      modules/blogging/app/Volo.BloggingTestApp/Program.cs
  5. 1
      modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj
  6. 4
      modules/client-simulation/demo/Volo.ClientSimulation.Demo/Program.cs
  7. 1
      modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj
  8. 4
      modules/docs/app/VoloDocs.Web/Program.cs
  9. 1
      modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj
  10. 1
      samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemo.Web.csproj
  11. 4
      samples/DashboardDemo/src/DashboardDemo.Web/Program.cs
  12. 1
      samples/MicroserviceDemo/applications/AuthServer.Host/AuthServer.Host.csproj
  13. 4
      samples/MicroserviceDemo/applications/AuthServer.Host/Program.cs
  14. 1
      samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminApp.Host.csproj
  15. 4
      samples/MicroserviceDemo/applications/BackendAdminApp.Host/Program.cs
  16. 4
      samples/MicroserviceDemo/applications/PublicWebSite.Host/Program.cs
  17. 1
      samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSite.Host.csproj
  18. 1
      samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj
  19. 4
      samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/Program.cs
  20. 1
      samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj
  21. 4
      samples/MicroserviceDemo/gateways/InternalGateway.Host/Program.cs
  22. 4
      samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/Program.cs
  23. 1
      samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj
  24. 1
      samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj
  25. 4
      samples/MicroserviceDemo/microservices/BloggingService.Host/Program.cs
  26. 3
      samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityService.Host.csproj
  27. 4
      samples/MicroserviceDemo/microservices/IdentityService.Host/Program.cs
  28. 1
      samples/MicroserviceDemo/microservices/ProductService.Host/ProductService.Host.csproj
  29. 4
      samples/MicroserviceDemo/microservices/ProductService.Host/Program.cs
  30. 1
      templates/mvc-module/host/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
  31. 4
      templates/mvc-module/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs
  32. 1
      templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
  33. 4
      templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs
  34. 1
      templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj
  35. 4
      templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/Program.cs
  36. 1
      templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/MyCompanyName.MyProjectName.Web.Unified.csproj
  37. 4
      templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs
  38. 1
      templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
  39. 4
      templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs
  40. 1
      templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
  41. 4
      templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs
  42. 1
      templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj
  43. 4
      templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/Program.cs
  44. 1
      templates/mvc/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
  45. 4
      templates/mvc/src/MyCompanyName.MyProjectName.Web/Program.cs

8
docs/en/Getting-Started-AspNetCore-Application.md

@ -159,6 +159,13 @@ public class Program
{
public static void Main(string[] args)
{
/*
https://github.com/aspnet/AspNetCore/issues/4206#issuecomment-445612167
CurrentDirectoryHelpers exists in: \framework\src\Volo.Abp.AspNetCore.Mvc\Microsoft\AspNetCore\InProcess\CurrentDirectoryHelpers.cs
Will remove CurrentDirectoryHelpers.cs when upgrade to ASP.NET Core 3.0.
*/
CurrentDirectoryHelpers.SetCurrentDirectory();
BuildWebHostInternal(args).Run();
}
@ -166,6 +173,7 @@ public class Program
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.Build();

8
docs/zh-Hans/Getting-Started-AspNetCore-Application.md

@ -163,12 +163,20 @@ public class Program
{
public static void Main(string[] args)
{
/*
https://github.com/aspnet/AspNetCore/issues/4206#issuecomment-445612167
CurrentDirectoryHelpers 文件位于: \framework\src\Volo.Abp.AspNetCore.Mvc\Microsoft\AspNetCore\InProcess\CurrentDirectoryHelpers.cs
当升级到ASP.NET Core 3.0的时候将会删除这个类.
*/
CurrentDirectoryHelpers.SetCurrentDirectory();
BuildWebHostInternal(args).Run();
}
public static IWebHost BuildWebHostInternal(string[] args) =>
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.Build();

63
framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/InProcess/CurrentDirectoryHelpers.cs

@ -0,0 +1,63 @@
using System;
namespace Microsoft.AspNetCore.InProcess
{
/// <summary>
/// https://github.com/aspnet/AspNetCore.Docs/blob/master/aspnetcore/host-and-deploy/aspnet-core-module/samples_snapshot/2.x/CurrentDirectoryHelpers.cs
/// TODO: Remove CurrentDirectoryHelpers.cs when upgrade to ASP.NET Core 3.0.
/// </summary>
public class CurrentDirectoryHelpers
{
internal const string AspNetCoreModuleDll = "aspnetcorev2_inprocess.dll";
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
private static extern IntPtr GetModuleHandle(string lpModuleName);
[System.Runtime.InteropServices.DllImport(AspNetCoreModuleDll)]
private static extern int http_get_application_properties(ref IISConfigurationData iiConfigData);
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
private struct IISConfigurationData
{
public IntPtr pNativeApplication;
[System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)]
public string pwzFullApplicationPath;
[System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)]
public string pwzVirtualApplicationPath;
public bool fWindowsAuthEnabled;
public bool fBasicAuthEnabled;
public bool fAnonymousAuthEnable;
}
public static void SetCurrentDirectory()
{
try
{
// Check if physical path was provided by ANCM
var sitePhysicalPath = Environment.GetEnvironmentVariable("ASPNETCORE_IIS_PHYSICAL_PATH");
if (string.IsNullOrEmpty(sitePhysicalPath))
{
// Skip if not running ANCM InProcess
if (GetModuleHandle(AspNetCoreModuleDll) == IntPtr.Zero)
{
return;
}
IISConfigurationData configurationData = default(IISConfigurationData);
if (http_get_application_properties(ref configurationData) != 0)
{
return;
}
sitePhysicalPath = configurationData.pwzFullApplicationPath;
}
Environment.CurrentDirectory = sitePhysicalPath;
}
catch
{
// ignore
}
}
}
}

4
modules/blogging/app/Volo.BloggingTestApp/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace Volo.BloggingTestApp
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug() //TODO: Should be configurable!
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
@ -38,6 +41,7 @@ namespace Volo.BloggingTestApp
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
<ItemGroup>

4
modules/client-simulation/demo/Volo.ClientSimulation.Demo/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace Volo.ClientSimulation.Demo
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
@ -38,6 +41,7 @@ namespace Volo.ClientSimulation.Demo
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
<ItemGroup>

4
modules/docs/app/VoloDocs.Web/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace VoloDocs.Web
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug() //TODO: Should be configurable!
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
@ -38,6 +41,7 @@ namespace VoloDocs.Web
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>

1
samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemo.Web.csproj

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>DashboardDemo</RootNamespace>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

4
samples/DashboardDemo/src/DashboardDemo.Web/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace DashboardDemo
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug() //TODO: Should be configurable!
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
@ -38,6 +41,7 @@ namespace DashboardDemo
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
samples/MicroserviceDemo/applications/AuthServer.Host/AuthServer.Host.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

4
samples/MicroserviceDemo/applications/AuthServer.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Events;
@ -12,6 +13,8 @@ namespace AuthServer.Host
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
//TODO: Temporary: it's not good to read appsettings.json here just to configure logging
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
@ -55,6 +58,7 @@ namespace AuthServer.Host
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminApp.Host.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

4
samples/MicroserviceDemo/applications/BackendAdminApp.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Events;
@ -12,6 +13,8 @@ namespace BackendAdminApp.Host
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
//TODO: Temporary: it's not good to read appsettings.json here just to configure logging
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
@ -55,6 +58,7 @@ namespace BackendAdminApp.Host
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

4
samples/MicroserviceDemo/applications/PublicWebSite.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Events;
@ -12,6 +13,8 @@ namespace PublicWebSite.Host
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
//TODO: Temporary: it's not good to read appsettings.json here just to configure logging
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
@ -55,6 +58,7 @@ namespace PublicWebSite.Host
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSite.Host.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

1
samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

4
samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Events;
@ -12,6 +13,8 @@ namespace BackendAdminAppGateway.Host
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
//TODO: Temporary: it's not good to read appsettings.json here just to configure logging
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
@ -55,6 +58,7 @@ namespace BackendAdminAppGateway.Host
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

4
samples/MicroserviceDemo/gateways/InternalGateway.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Events;
@ -12,6 +13,8 @@ namespace InternalGateway.Host
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
//TODO: Temporary: it's not good to read appsettings.json here just to configure logging
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
@ -55,6 +58,7 @@ namespace InternalGateway.Host
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

4
samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Events;
@ -12,6 +13,8 @@ namespace PublicWebSiteGateway.Host
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
//TODO: Temporary: it's not good to read appsettings.json here just to configure logging
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
@ -55,6 +58,7 @@ namespace PublicWebSiteGateway.Host
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

1
samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

4
samples/MicroserviceDemo/microservices/BloggingService.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Events;
@ -12,6 +13,8 @@ namespace BloggingService.Host
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
//TODO: Temporary: it's not good to read appsettings.json here just to configure logging
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
@ -55,6 +58,7 @@ namespace BloggingService.Host
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

3
samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityService.Host.csproj

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

4
samples/MicroserviceDemo/microservices/IdentityService.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Events;
@ -12,6 +13,8 @@ namespace IdentityService.Host
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
//TODO: Temporary: it's not good to read appsettings.json here just to configure logging
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
@ -55,6 +58,7 @@ namespace IdentityService.Host
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
samples/MicroserviceDemo/microservices/ProductService.Host/ProductService.Host.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

4
samples/MicroserviceDemo/microservices/ProductService.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Events;
@ -12,6 +13,8 @@ namespace ProductService.Host
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
//TODO: Temporary: it's not good to read appsettings.json here just to configure logging
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
@ -55,6 +58,7 @@ namespace ProductService.Host
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
templates/mvc-module/host/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace>
</PropertyGroup>

4
templates/mvc-module/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace MyCompanyName.MyProjectName
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
@ -42,6 +45,7 @@ namespace MyCompanyName.MyProjectName
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace>
</PropertyGroup>

4
templates/mvc-module/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace MyCompanyName.MyProjectName
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
@ -42,6 +45,7 @@ namespace MyCompanyName.MyProjectName
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace>
</PropertyGroup>

4
templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace MyCompanyName.MyProjectName
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
@ -42,6 +45,7 @@ namespace MyCompanyName.MyProjectName
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/MyCompanyName.MyProjectName.Web.Unified.csproj

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace>
</PropertyGroup>

4
templates/mvc-module/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace MyCompanyName.MyProjectName
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
@ -38,6 +41,7 @@ namespace MyCompanyName.MyProjectName
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace>
</PropertyGroup>

4
templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace MyCompanyName.MyProjectName
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
@ -42,6 +45,7 @@ namespace MyCompanyName.MyProjectName
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

4
templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace MyCompanyName.MyProjectName
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
@ -42,6 +45,7 @@ namespace MyCompanyName.MyProjectName
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>MyCompanyName.MyProjectName.Web</RootNamespace>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

4
templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace MyCompanyName.MyProjectName.Web
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
@ -42,6 +45,7 @@ namespace MyCompanyName.MyProjectName.Web
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

1
templates/mvc/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>MyCompanyName.MyProjectName.Web</RootNamespace>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

4
templates/mvc/src/MyCompanyName.MyProjectName.Web/Program.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog;
using Serilog.Events;
@ -10,6 +11,8 @@ namespace MyCompanyName.MyProjectName.Web
{
public static int Main(string[] args)
{
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
@ -42,6 +45,7 @@ namespace MyCompanyName.MyProjectName.Web
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()

Loading…
Cancel
Save