Questions

Has been blocked by CORS policy: Response to preflight request doesn’t pass access control check

I have created trip server. It works fine and we are able to make `POST` request by Insomnia but when we make `POST` request by axios on our front-end, it sends an error: ``` has been blocked by CORS...

5 Jul at 10:46

Is there a way to add claims in an ASP.NET Core middleware after Authentication?

I have this in my startup: ``` public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else ...

14 Nov at 08:20

ASP.NET Core web service does not load appsettings.json into configuration

I have an ASP.NET Core 2.1 Web Application with Razor Pages which has AAD authentication information defined in the `appsettings.json` file (courtesy of the default application template - see below on...

14 Nov at 16:18

ServiceStack: AppHost does not support accessing the current Request via a Singleton

I'm encountering the following exception when trying using `this.SessionAs<T>` within one of my services: > "AppHost does not support accessing the current Request via a Singleton" The offending c...

14 Nov at 16:52

Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code

``` Showing Recent Messages:-1: mkdir -p /Users/spritzindia/Library/Developer/Xcode/DerivedData/Contigo-atftiouzrdopcmcpprphpilawwzm/Build/Products/Debug-iphonesimulator/Contigo.app/Frameworks Showin...

31 Dec at 13:44

Why is ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ the native name of the U.S.?

When I use this code: ``` var ri = new RegionInfo("us"); var nativeName = ri.NativeName; // ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ ``` why is `nativeName` then the string `"ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ"` (in [Cherokee](https://en.w...

java.lang.IllegalStateException: Failed to introspect Class

I am trying to add Elasticsearch to my project. I have addded the necessary dependencies to my pom.xml file. When I run the server I am getting this error: > ``` java.lang.IllegalStateException: Fail...

14 Nov at 07:25

SwaggerUI not display enum summary description, C# .net core?

I used [https://learn.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-2.1&tabs=visual-studio#xml-comments](https://learn.microsoft.com/en-us/aspnet/core/tuto...

Do C# 8 default interface implementations allow for multiple inheritance

According to [https://blogs.msdn.microsoft.com/dotnet/2018/11/12/building-c-8-0/](https://blogs.msdn.microsoft.com/dotnet/2018/11/12/building-c-8-0/), one of the new features coming in C# 8 is the def...

how to apply common configuration to all entities in ef core

I have entities derived from a base entity in my application which uses ef core code-first approach. ``` public abstract class BaseEntity<T> : IEntity<T> { [Key] [DatabaseGenerated(Database...

13 Nov at 07:5

Is ArrayPool<T>.Rent(Int32) Method thread-safe?

I just found out about ArrayPool existence, but it's documentation is somewhat lacking. I'd like to know if [Rent(.)](https://learn.microsoft.com/en-us/dotnet/api/system.buffers.arraypool-1.rent?view...

13 Nov at 04:55

WebApplicationFactory throws error that contentRootPath does not exist in ASP.NET Core integration test

I have a ASP.NET Core project with some simple Razor pages and a Web API controller. I'm using [Clean Architecture](https://github.com/ardalis/CleanArchitecture) as a starting point. I've renamed the...

12 Nov at 20:44

Create new local server in pgadmin?

I have PostgreSQL 11 and PGadmin 4 installed on windows. Currently I'm connected to a AWS server which hosts all of my data. I want to create a local server (localhost) as a testing environment where...

25 Sep at 06:20

C# Async await deadlock problem gone in .NetCore?

In .NetFramework there was a high risk of a deadlock occuring when synchronizing to the synchronization context using: ``` var result = asyncMethod().Result; var result = asyncMethod().GetAwaiter(...

Why should I return ActionResult instead of object?

Assuming that I have application .NET Core 2.1 Web API + Angular 7 Why should I always returns `ActionResult`? Is there any difference between this: ``` public ActionResult<MyDTO> GetData(){ retur...

6 Jul at 02:17

Access to XMLHttpRequest has been blocked by CORS policy

I've a problem when I try to do PATCH request in an angular 7 web application. In my backend I have: ``` app.use((req, res, next) => { res.set({ "Access-Control-Allow-Origin": "*", ...

16 Jan at 08:59

Identity Server 4 - IDX10630: PII is hidden

I'm fairly new to using encryption and rsa tokens and I'm trying to get IDentityServer4 to not use the developersigning, but one of my own. Here is what I have tried so far: ``` var keyInfo = new RSA...

12 Nov at 02:22

Why is ASP.NET Core's Startup class not an interface or abstract class?

This is in regards to the design principals behind the `Startup` class explained here: [https://learn.microsoft.com/en-us/aspnet/core/fundamentals/startup?view=aspnetcore-2.1](https://learn.microsoft...

Make React useEffect hook not run on initial render

According to the docs: > `componentDidUpdate()` is invoked immediately after updating occurs. This method is not called for the initial render. We can use the new `useEffect()` hook to simulate `com...

12 Nov at 06:52

'IServiceCollection' does not contain a definition for 'AddSpaStaticFiles'

I cant figure out why Startup.cs is throwing this error. I tried the solutions suggested [here](https://stackoverflow.com/questions/44409554/iservicecollection-does-not-contain-a-definition-for-addses...

11 Nov at 21:43

react evironment variables .env return undefined

I am building a react app and i need to fetch data from my api, now i want to store the api url as an environment variable. I have my .env file, i have dotenv installed, here is my code process.env.AP...

10 Nov at 08:31

Logging in .NET Core without DI?

It seems that Microsoft are really trying to shove DI down your throat with .NET Core, and I'm not sure why, but frankly my console app is small and simple and I just don't want to build a whole DI co...

10 Nov at 02:16

Bundler: You must use Bundler 2 or greater with this lockfile

I'm working with heroku and every time I try to push my app this message shows out: ``` remote: Compressing source files... done. remote: Building source: remote: remote: -----> Ruby app detected r...

Terminal error: zsh: permission denied: ./startup.sh

I am running a command ``` ./startup.sh nginx:start ``` and I am getting this error message ``` zsh: permission denied: ./startup.sh ``` why could this be happening?

22 Aug at 21:18

Get json casing in backend

Is there a method I can use that gets the casing that is used when ServiceStack converts DTO properties into Json response? For instance a backend model property name `MyProperty` becomes json proper...

9 Nov at 14:7