asp.net-core-2.2

Can't display static image in the same folder as the component in Angular [closed]

流过昼夜 提交于 2019-12-02 13:39:13
In the directory of my component, I've put an image. It's a good, old, plain PNG with a logotyp. So there are four files in there: blobb.png blobb.comp.ts blobb.comp.html blobb.comp.scss In the HTML file, I used a static source link in a default IMG tag like this. <img src="./blobb.png"> I was trying to follow the setup suggested in this blog . At the moment, I have no need for dynamic images. The static ones will suffice. My understanding's that assets folder is an option but not required. There's no error, except for the 404 Not found, of course. The link to the missing file is: https:/

ASP.NET Core Route attributes available in entire controller class

久未见 提交于 2019-12-01 23:10:33
Is there a way to make attributes specified in the route available in the whole class? For instance, consider this Controller: [Route("api/store/{storeId}/[controller]")] public class BookController { [HttpGet("{id:int:min(1)}")] public async Task<IActionResult> GetBookById(int storeId, int id) { } } And this request: /api/store/4/book/1 Inside the GetBookById method, the storeId variable is correctly populated with 4 and the id variable with 1. However, instead of having to pass the storeId variable in every method of the BookController, is there a way to do something like this: [Route("api

Retrieve IIS log parameter value from HTTP-Request/Response object

荒凉一梦 提交于 2019-12-01 10:43:42
问题 I want to write custom log for my application similar to IIS log using .net core . For below fields I am not able to retrieve information from HTTP-Request/Response object. Parameter : . Service Name and Instance Number (s-sitename) . User Name (cs-username) . Cookie (cs - Cookie) . Protocol Substatus(sc substatus) . Win32 Status(sc-win32-status) . Bytes Sent (sc-bytes ) . Bytes Received (cs-bytes) apart from above fields, I have able to extract other fields information. Example: [Server Name

How to fix obsolete ILoggerFactory methods?

谁都会走 提交于 2019-11-30 11:47:21
问题 I upgraded my project to .NET Core 2.2.x and got an obsolete warning regarding the following code - both lines: public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); The suggestion to fix is The recommended alternative is AddConsole(this ILoggingBuilder builder) . I thought that is what I am using. What am I missing here? 回答1: I had the same issue today. Remove your logging

Entity Framework Core - EF Core 2.2 - 'Point.Boundary' is of an interface type ('IGeometry')

◇◆丶佛笑我妖孽 提交于 2019-11-30 04:46:35
问题 I am trying the new functionality with EF Core 2.2. It is based on the following article. "Announcing Entity Framework Core 2.2" https://blogs.msdn.microsoft.com/dotnet/2018/12/04/announcing-entity-framework-core-2-2/ I installed the following Nuget package. I added the following to my model. using NetTopologySuite.Geometries; //New as of EF.Core 2.2 //[Required] //[NotMapped] public Point Location { get; set; } During my application startup I get the following error in my Database Context on

SignalR Core 2.2 CORS AllowAnyOrigin() breaking change

我是研究僧i 提交于 2019-11-28 03:28:24
问题 To connect via SignalR to an ASP.NET Core 2.1 server from any origin, we had to configure the pipeline as follows: app.UseCors ( builder => builder .AllowAnyHeader () .AllowAnyMethod () .AllowAnyOrigin () .AllowCredentials () ) According to this document, ASP.NET Core 2.2 no longer allows the combination of AllowAnyOrigin and AllowCredentials, so what would be the solution? Whereas the SignalR Core always sends withCredentials:true in the XMLHtppRequest. What I need is that from any origin

SignalR Core 2.2 CORS AllowAnyOrigin() breaking change

ぐ巨炮叔叔 提交于 2019-11-28 01:20:33
To connect via SignalR to an ASP.NET Core 2.1 server from any origin, we had to configure the pipeline as follows: app.UseCors ( builder => builder .AllowAnyHeader () .AllowAnyMethod () .AllowAnyOrigin () .AllowCredentials () ) According to this document, ASP.NET Core 2.2 no longer allows the combination of AllowAnyOrigin and AllowCredentials, so what would be the solution? Whereas the SignalR Core always sends withCredentials:true in the XMLHtppRequest. What I need is that from any origin and without credentials, our users can connect to the SignalR Hub. There is a workaround, change

Serilog does not write log to file while using InProcess hosting model in ASP.NET Core 2.2

↘锁芯ラ 提交于 2019-11-27 09:31:41
If I use newly introduced InProcess hosting model in ASP.NET Core 2.2 as follows: <PropertyGroup> <TargetFramework>netcoreapp2.2</TargetFramework> <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> </PropertyGroup> Serilog does not write log to file. but if I remove <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> from .csproj everything works as expected. My Serilog configuration in the Program class as follows: public class Program { public static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Information() // Set the minimun log level

Serilog does not write log to file while using InProcess hosting model in ASP.NET Core 2.2

时光怂恿深爱的人放手 提交于 2019-11-26 14:46:53
问题 If I use newly introduced InProcess hosting model in ASP.NET Core 2.2 as follows: <PropertyGroup> <TargetFramework>netcoreapp2.2</TargetFramework> <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> </PropertyGroup> Serilog does not write log to file. but if I remove <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> from .csproj everything works as expected. My Serilog configuration in the Program class as follows: public class Program { public static void Main(string[] args)