logo
down
shadow

ASP.NET-CORE QUESTIONS

Asp.Net Core Log Statements Not showing up in Application Insights
Asp.Net Core Log Statements Not showing up in Application Insights
I wish this help you Can you describe how did you enable ApplicationInsights for capturing ILogger? If you are in the latest beta version of the SDK, ILogger traces are captured without explicit action. But it'll only capture Warning or above level l
TAG : asp.net-core
Date : October 23 2020, 06:10 PM , By : HLM
What replaces SynchronizationContext in ASP.NET Core?
What replaces SynchronizationContext in ASP.NET Core?
it fixes the issue TL;DR The continuation don't have to return to original thread.Stephen Cleary has nice explanation to why ASP.NET Core doesn't have SynchronizationContext.
TAG : asp.net-core
Date : October 22 2020, 06:10 PM , By : John
Should I use Request-Id, X-Request-Id or X-Correlation-Id in the request header?
Should I use Request-Id, X-Request-Id or X-Correlation-Id in the request header?
With these it helps For Request-Id, it's uniquely identifies every HTTP request involved in operation processing, and is generated on the caller side and passed to callee. For X-Correlation-ID, also known as a Transit ID, is a unique identifier value
TAG : asp.net-core
Date : October 21 2020, 06:10 PM , By : Spondoolees
Azure AD B2C KMSI (Keep Me Signed In) does not keep me signed in
Azure AD B2C KMSI (Keep Me Signed In) does not keep me signed in
wish help you to fix your issue At the moment Keep me sign in is not supported in basic user flows. Please use Page Layout Version 1.0.0 for Unified sign up or sign in page, so the KMSI check box will not appear.
TAG : asp.net-core
Date : October 18 2020, 06:10 PM , By : user6021313
Sending a message to whatsapp groups through twilio with asp.net core
Sending a message to whatsapp groups through twilio with asp.net core
it helps some times I am trying to use whatsapp business api for my application with twilio. I already have read the documentation of whatsapp business api. My question is, can we use twilio to send the messages to different whatsapp group based on i
TAG : asp.net-core
Date : October 17 2020, 06:10 PM , By : dondonudon
How to write an EasyNetQ auto subscriber dispatcher for the ASP.NET Core services provider?
How to write an EasyNetQ auto subscriber dispatcher for the ASP.NET Core services provider?
I hope this helps you . So, the EasyNetQ auto subscriber has a basic default dispatcher that cannot create message consumer classes with non-parameterless constructors. , So, here's what I came up with.
TAG : asp.net-core
Date : October 17 2020, 06:10 AM , By : ahojcek
Is there any convention or built in concept how to inject a Json serializer?
Is there any convention or built in concept how to inject a Json serializer?
hope this fix your issue If it helps, ASP.NET Core is abstracting the JSON serializer itself in some places. For example, within Razor views (both views and pages), you can use Json.Serialize() to serialize stuff into the body. This uses the IJsonHel
TAG : asp.net-core
Date : October 13 2020, 09:00 PM , By : user6023798
Adding claims to IdentityServer setup by AddIdentityServer
Adding claims to IdentityServer setup by AddIdentityServer
Any of those help On Identity Server side , you can create Profile Service to make IDS4 include role claim when issuing tokens .You can get role claims from ClaimsPrincipal or get the roles from database and create profile service like :
TAG : asp.net-core
Date : October 13 2020, 10:00 AM , By : vtepliuk
Razor pages and webapi in the same project
Razor pages and webapi in the same project
I wish did fix the issue. You need to configure your startup to support web api and attribute routing.services.AddControllers() adds support for controllers and API-related features, but not views or pages. Refer to MVC service registration.
TAG : asp.net-core
Date : October 13 2020, 07:00 AM , By : LethalRose
ASP .NET Core webapi set cookie in middleware
ASP .NET Core webapi set cookie in middleware
seems to work fine Ok, I'm talking to myself, but this is for the community...Got this working after digging into the AspNetCore code. Basically the cookie must be set on the callback OnStarting of the context response. Here is the code of the middle
TAG : asp.net-core
Date : October 12 2020, 04:00 AM , By : Ivan Georgiev
Add custom fields for AspNetUser
Add custom fields for AspNetUser
should help you out Custom user data is supported by inheriting from IdentityUser. It's customary to name this type ApplicationUser:
TAG : asp.net-core
Date : October 12 2020, 04:00 AM , By : Davit Yeghiazaryan
How to create .razor files
How to create .razor files
Hope that helps In VS 2019 16.3.0, adding "Razor Component" is what worked for me.
TAG : asp.net-core
Date : October 11 2020, 07:00 PM , By : sam
ASP.NET Core 2.2 - accessing the StaticFileOption RequestPath later in code
ASP.NET Core 2.2 - accessing the StaticFileOption RequestPath later in code
will help you Not entirely sure if it is possible but a workaround can be an appsettings key and read it from both locations.ex: in your appsettings
TAG : asp.net-core
Date : October 11 2020, 03:00 PM , By : Asher Meir
Prevent Kestrel From Crashing When Port Is In Use
Prevent Kestrel From Crashing When Port Is In Use
Hope that helps You can use port 0; with that, Kestrel dynamically binds to an available port at runtime as said here:
TAG : asp.net-core
Date : October 11 2020, 05:00 AM , By : Nanjappa Nanjundaiah
How can we integrate identityserver4 and web api in the same project(port) instead of creating different projects for ea
How can we integrate identityserver4 and web api in the same project(port) instead of creating different projects for ea
I think the issue was by ths following , It is now a built-in feature of Identityserver. Added with this PR.
TAG : asp.net-core
Date : October 11 2020, 03:00 AM , By : Peeyush Patil
ASP.Net Core 2.2 Kubernetes Ingress
ASP.Net Core 2.2 Kubernetes Ingress
I wish this helpful for you Follow these steps to run your code: ingress: remove URL-rewriting from ingress.yml
TAG : asp.net-core
Date : October 11 2020, 02:00 AM , By : Jason G. Sturgill
Bundling and Minification without using tools in ASP.NET MVC Core 2.2 web application
Bundling and Minification without using tools in ASP.NET MVC Core 2.2 web application
fixed the issue. Will look into that further ASP.NET supports bundling and minification out of the box, but same is not true for ASP.NET Core.If you intend for css and javascript files, ASP.NET Core comes with a built in BundlerMinifier.In ASP.NET Co
TAG : asp.net-core
Date : October 10 2020, 05:00 PM , By : Martin M
Using httpClient.postasync for web api calls .netcore
Using httpClient.postasync for web api calls .netcore
hop of those help? I am new to .netcore, I am working on web api that are running on docker container and while using postman the web api's are working really fine outputting the results. I want to make a program in .netcore calling the webapi endpoi
TAG : asp.net-core
Date : October 10 2020, 03:00 PM , By : Rodrigo Allemand
Which way to use HttpClientFactory is better?
Which way to use HttpClientFactory is better?
Does that help I am developing a web api service using ASP.NET Core and i need to do http requests. I read a lot about HttpClient and I know i have to use HttpClientfactory instead. I'm going to incapsulate http request calls into my custom class. ,
TAG : asp.net-core
Date : October 09 2020, 02:00 PM , By : Umut Wizka
Micro-service architecture in .NET Core: pattern or library for services to call each other
Micro-service architecture in .NET Core: pattern or library for services to call each other
wish of those help In a micro-service architecture, the most important thing is a clear separation of concerns and application boundaries. Imagine a simple setup, with Product and Price micro services
TAG : asp.net-core
Date : October 09 2020, 12:00 PM , By : Luismi López
How to login a user with a JWT in asp.net core
How to login a user with a JWT in asp.net core
I hope this helps you . Your client application that wants to authenticate should communicate with the Identity Server application on the Open ID Connect (OIDC) protocol. Asp.net core supports this out of the box with AddAuthentication().AddOpenIdCon
TAG : asp.net-core
Date : October 09 2020, 07:00 AM , By : 廖一维
Get String value from Enum in .net core Authorize Attribute
Get String value from Enum in .net core Authorize Attribute
Does that help I have a extensions method and I use it to read the name of display attribute
TAG : asp.net-core
Date : October 09 2020, 02:00 AM , By : minsik kim
How to get host URL in the background service in asp .net core web api?
How to get host URL in the background service in asp .net core web api?
I wish this help you Background services run outside the scope of a web request, hence background service. This means that there is no HTTP context available where you can grab the host of the application from. I suggest you create an application set
TAG : asp.net-core
Date : October 09 2020, 02:00 AM , By : Stan R
Registering multiple DbContext Instances on startup for use in Generic Repository
Registering multiple DbContext Instances on startup for use in Generic Repository
I think the issue was by ths following , That's not how you register DbContext, which is the source of your problem. The correct method is:
TAG : asp.net-core
Date : October 09 2020, 01:00 AM , By : fenu
Kestrel address binding errors in azure app service
Kestrel address binding errors in azure app service
Any of those help The issue turned out to be that the application was already running but was not taking requests due to trying to use kestrel in the azure app service. I had to use .UseIIS() to get it to work. Perhaps I was doing something wrong.
TAG : asp.net-core
Date : October 08 2020, 03:00 AM , By : Cherish1990
Razor Pages - Run a server side method NOT using post
Razor Pages - Run a server side method NOT using post
this will help As it stands, the button won't do anything. You can use JavaScript to intercept the button click and then fire a get request using AJAX (jQuery example below):
TAG : asp.net-core
Date : October 07 2020, 05:00 PM , By : thouraya
Unable to reference a Blazor Component Library project
Unable to reference a Blazor Component Library project
will help you I am trying to follow this article to create a razor component library. This in itself is not an issue. , Let's begin here:
TAG : asp.net-core
Date : October 07 2020, 01:00 PM , By : Johann Deysel
SwaggerUI not adding ApiKey to Header with Swashbuckle (5.x)
SwaggerUI not adding ApiKey to Header with Swashbuckle (5.x)
Hope this helps OK, I was finally able to get this to work. I needed to add an instance of OpenApiReference to the OpenApiSecurityScheme object provided to c.AddSecurityRequirement()
TAG : asp.net-core
Date : October 07 2020, 04:00 AM , By : Yahya Yahya
How to configure key settings for IdentityServer in appsettings.json for aspnet core app running on IIS
How to configure key settings for IdentityServer in appsettings.json for aspnet core app running on IIS
may help you . For now I have worked around this problem by exporting the certificate to a file. Under Server Certificates in IIS you can right-click a certificate and export it.Then you can configure the key parameters in appsettings.json to referen
TAG : asp.net-core
Date : October 07 2020, 01:00 AM , By : user42657
How to format the date using local culture using the blazor <InputDate /> tag
How to format the date using local culture using the blazor <InputDate /> tag
Hope this helps I am using the tag in my Blazor app. But how can i format the date using my own culture ? , The answer is @bind-Value:format, like so
TAG : asp.net-core
Date : October 05 2020, 09:00 AM , By : Terry Stoneberg
EF Core FromSql for same model but with different queries and extra columns
EF Core FromSql for same model but with different queries and extra columns
With these it helps you can map your data to a DTO (Data Transfer Object).This DTO can be customized depending on your needs
TAG : asp.net-core
Date : October 05 2020, 07:00 AM , By : Alejandro R art22art
What is the difference between .Net Core installer vs .Net Core binaries?
What is the difference between .Net Core installer vs .Net Core binaries?
fixed the issue. Will look into that further The binaries are .NET Core's compiled code. They have all the information needed to run .NET Core, but they do not prep your computing environment. The .NET Core installers automate the setup processes by
TAG : asp.net-core
Date : October 05 2020, 05:00 AM , By : Richard E. Baldeon C
Web API EF Core exceptions being swallowed?
Web API EF Core exceptions being swallowed?
wish of those help Note that this isn't specific to IQueryable, but to any IEnumerable where the results haven't been realized yet.The actual query is performed when the object is enumerated, which is done by ASP.NET when it's constructing the respon
TAG : asp.net-core
Date : October 03 2020, 11:00 AM , By : black_heart
_context.SaveChanges() works but await _context.SaveChangesAsync() doesn't
_context.SaveChanges() works but await _context.SaveChangesAsync() doesn't
it fixes the issue As I said in my comment above, EF Core has no true sync methods. The sync methods (e.g. SaveChanges) merely block on the async methods (e.g. SaveChangesAsync). As such, it's impossible that SaveChanges would work, if SaveChangesAsy
TAG : asp.net-core
Date : October 03 2020, 03:00 AM , By : Tanooj Parekh
Azure, Error 403 - Forbidden: Client Certificate Required
Azure, Error 403 - Forbidden: Client Certificate Required
I wish this helpful for you Eventually, I got the answer and it works well
TAG : asp.net-core
Date : October 01 2020, 05:00 PM , By : Mr. PG
Using IQueryable in onPost method
Using IQueryable in onPost method
help you fix your problem The exception tells you the problem and how to fix it: you can't bind to an IQueryable, you need something like List:
TAG : asp.net-core
Date : October 01 2020, 04:00 PM , By : Lakshmi Navya
AspNetCore OData not working on .NET Core 3.0
AspNetCore OData not working on .NET Core 3.0
around this issue I've been trying to fight this error all day. Finally found out the problem: Odata is simply not compatible yet with .NET Core 3.0. Follow this thread for a bit more information.
TAG : asp.net-core
Date : October 01 2020, 12:00 PM , By : makubex
Is there any way to block HTTP requests made by Postman in .NET Core?
Is there any way to block HTTP requests made by Postman in .NET Core?
will be helpful for those in need I am not aware of anything that gives away the fact that the request is made via Postman. At the end of the day, Postman is a simple client so the fact that the request is coming through it, or any other client as a
TAG : asp.net-core
Date : September 30 2020, 06:00 PM , By : hadzoemir
Asp.net core 3.0 on Elastic Beanstalk
Asp.net core 3.0 on Elastic Beanstalk
To fix this issue Edit 30/10/2019Elastic Beanstalk now supports .NET Core 3.0 so no need for any workarounds
TAG : asp.net-core
Date : September 30 2020, 04:00 PM , By : Leandro Nahuel Jara
graceful shutdown asp.net core
graceful shutdown asp.net core
To fix this issue For capturing graceful shutdown, you could try IHostApplicationLifetime.
TAG : asp.net-core
Date : September 29 2020, 02:00 PM , By : josef256
Server response "unsupported media type" when I send JSON format data to Asp.net Core 3.0
Server response "unsupported media type" when I send JSON format data to Asp.net Core 3.0
hop of those help? contentType is the type of data you're sending, and application/json; charset=utf-8 is a common one to send json data.In your case, data {a:1,b:2} is only a Javascript object so you need to use the JSON.stringify() method to conver
TAG : asp.net-core
Date : September 28 2020, 03:00 PM , By : Tyrance
service locater pattern vs service aggregate factory on inheritance
service locater pattern vs service aggregate factory on inheritance
I wish did fix the issue. Say I have a base class that needs a bunch of services. And this base class has some derived classes.
TAG : asp.net-core
Date : September 28 2020, 02:00 PM , By : dodo
Unable to create swagger.json file when using aspnet-api-versioning
Unable to create swagger.json file when using aspnet-api-versioning
Hope that helps I have .NET Core 2.2 application. I am trying to set up API with different versions using Microsoft.AspnetCore.Mvc.Versioning nugetpackage. I followed the samples provided in the repository. , found.. i am missing [HttpGet] attribute
TAG : asp.net-core
Date : September 28 2020, 11:00 AM , By : Fish Cheng
How to deserialize ProblemDetails in ASP.NET Core 2.2
How to deserialize ProblemDetails in ASP.NET Core 2.2
will be helpful for those in need ReadAsAsync is unfamiliar with the application/problem+json media type, and does not have a formatter that can handle that type by default, hence the errorYou can use the long approach and get the string first then u
TAG : asp.net-core
Date : September 28 2020, 06:00 AM , By : Mayank Jain
How to use bind-value and bind-value:event on a custom component Blazor
How to use bind-value and bind-value:event on a custom component Blazor
this one helps. In Blazor, while using inputs, , The event parameter MUST be called ValueChanged
TAG : asp.net-core
Date : September 26 2020, 05:00 AM , By : Ming Yan
Scaffolding Idenitiy in ASP.NET Core error
Scaffolding Idenitiy in ASP.NET Core error
like below fixes the issue you can fix the template there are some ) missing. The template file is specified in the error. (C:\Users***.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\3.0.0\Templates\IdentityVersioned\Bootstrap3\Pages\Ac
TAG : asp.net-core
Date : September 26 2020, 02:00 AM , By : aymen mokhtar
.Net Core on Raspberry Pi 4 with Raspbian?
.Net Core on Raspberry Pi 4 with Raspbian?
I wish this helpful for you Download .Net Core 3.1 SDK from HEREMake Directory:
TAG : asp.net-core
Date : September 25 2020, 04:00 PM , By : D. Rodriguez
ASP.NET Razor page, change color of particular row of table based on conditions?
ASP.NET Razor page, change color of particular row of table based on conditions?
should help you out I have a table something like this.
TAG : asp.net-core
Date : September 22 2020, 08:00 AM , By : Giovanni Fedele
Processing unhandled exceptions in ASP.NET Core 3.1
Processing unhandled exceptions in ASP.NET Core 3.1
will help you I recommand to use Serilog with sinks you need. In your project add packages :
TAG : asp.net-core
Date : September 21 2020, 09:00 PM , By : Rifki Salman Al-Fari
Validate jwt token from ASP.NET Core controller when not using Authorize attribute
Validate jwt token from ASP.NET Core controller when not using Authorize attribute
Hope this helps Since your access token is generated by IdentityServer4, then you should validate it using the IS4 Introspection Endpoint. This will give you the definitive answer as to if it is valid and whether or not it is still active.Information
TAG : asp.net-core
Date : September 21 2020, 08:00 PM , By : Fernando Luque
How to use OData in a Asp.Net Core Razor Page Project (without MVC, API)
How to use OData in a Asp.Net Core Razor Page Project (without MVC, API)
it should still fix some issue Based on the OData documentation - OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming REST APIs. It enables the creation of REST-based servi
TAG : asp.net-core
Date : September 21 2020, 07:00 PM , By : Thiago Santos
Can I conditionally add a hosted service based on options?
Can I conditionally add a hosted service based on options?
wish helps you If I understand your mean correctly , you want to use the option read from other files(such as appsettings.json) to determine whether to add a hosted service .You could refer to the two following different methods:1.read option value f
TAG : asp.net-core
Date : September 20 2020, 07:00 AM , By : Ivan Petrov
.NET core 3.1 app shows "Handler "aspNetCore" has a bad module "AspNetCoreModuleV2" in its modu
.NET core 3.1 app shows "Handler "aspNetCore" has a bad module "AspNetCoreModuleV2" in its modu
Hope this helps You will have to ask your hosting provider to install the ASP.NET Core 3.1 Hosting Bundle which includes the Version 2 of the ASP.NET Core Module for IIS.ASP.NET Core 3.x applications require this module version in order to run on IIS
TAG : asp.net-core
Date : September 19 2020, 03:00 PM , By : Marcelo Caparelli
Problem with Bootstrap and bundle in ASP.NET Core
Problem with Bootstrap and bundle in ASP.NET Core
I wish this help you The first way is to copy the css and js file to wwwroot/lib folder in your project.The second way is to use BootstrapCDN if you want to skip the download.
TAG : asp.net-core
Date : September 19 2020, 03:00 PM , By : Dan Milliorn
Referencing .NET Framework DLL from .Net Core 3
Referencing .NET Framework DLL from .Net Core 3
help you fix your problem You can analyze the DLL with The .NET Portability Analyzer. If all classes and methods that the DLL uses are available in .NET Standard/.NET Core then CLR will be able to call those methods. But some apis are not yet ported
TAG : asp.net-core
Date : September 14 2020, 04:00 PM , By : Samantha Zhang
Proper way to update data in lookup tables with EFcore / ASP.net core? Do I do this in the seed method or another way?
Proper way to update data in lookup tables with EFcore / ASP.net core? Do I do this in the seed method or another way?
Hope this helps The way you're seeding currently is deprecated. If you handle the seeding as you're supposed to, then inserts, updates, etc. of the seed data are handled automatically by EF Core. It is now done via fluent config in OnModelCreating in
TAG : asp.net-core
Date : September 11 2020, 12:00 AM , By : PujaK
extending IServiceCollection in asp net core
extending IServiceCollection in asp net core
will help you In your library, you can create a static class and write some extensions methods where you can register your dependencies as the following example:
TAG : asp.net-core
Date : September 05 2020, 10:00 PM , By : Tom Jones
how to use async method inside lock
how to use async method inside lock
Hope this helps Given the multi threaded environment i want to make sure only one Worker can store the collection in the cache and find it.
TAG : asp.net-core
Date : September 01 2020, 01:00 PM , By : Jabong Trésor
Nopcommerce Okta Integration
Nopcommerce Okta Integration
it helps some times I thought I would share the results of my tests thus far as it uncovered some things I really didn't expect. Maybe these things are obvious/known to most of you - but for me they definitely proved to be tricky.The first important
TAG : asp.net-core
Date : August 22 2020, 05:00 AM , By : Louise Macbride
shadow
Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk