How to use ConfigurationManager? (Microsoft.IdentityModel.Protocols)

I was recently forced to update my System.IdentityModel.Tokens.Jwt NuGet package to 5.1.4 because of another NuGet package. Most of the code after changes seem easy enough to solve, but now `Configur...

4 Aug at 07:32

Is there any way to get request body in .NET Core FilterAttribute?

Sample of my request ``` http://localhost:8065/api/note POST content-type:application/json request body: { "id" : "1234", "title" : "test", "status" : "draft"} ``` and the response should be ``` {...

Why does calling a generic local function with a dynamic parameter produce a BadImageFormatException?

Playing around with C# 7's Local Functions, I ended up with some interesting behavior. Consider the following program: ``` public void Main() { Console.WriteLine("Entered Main"); DoSomething(...

3 Aug at 23:2

ASP.NET Core MVC Mixed Route/FromBody Model Binding & Validation

I am using ASP.NET Core 1.1 MVC to build an JSON API. Given the following model and action method: ``` public class TestModel { public int Id { get; set; } [Range(100, 999)] public int ...

AutoQuery / Ormlite-servicestack: Can I filter out soft deletes on a QueryDb class?

We have a few services built up with Ormlite/Servicestack and we are mostly pulling out database objects and POCOs using `QueryData` with custom logic. However, we have one table that really doesn't ...

How can I validate Request.Headers["Authorization"] for all controller at a single place?

``` [HttpGet] public IActionResult Get() { string token = Request.Headers["Authorization"]; // Validate token. } [HttpPost] public IActionResult Post(int id) { string token = Request.Head...

3 Aug at 21:50

How can I use, in Visual Studio 2017, the "C# Interactive" window to query a source in my "Data Connections"

I'm connected to an external SQL server in my "Data Connections" (in the "Server Explorer" view). I can right click my SQL source and click "New Query" to quickly look up data with SQL statements. I ...

React Navigation back() and goBack() not working

I'm trying to go back two screens. The goal is to go from `EditPage` to `Cover`. Here is my navigation stack: `Main -> Cover -> EditCover -> EditPage` I read the docs and it says to supply a key ...

4 Aug at 08:49

ServiceStack Register web service slow performance

We noticed some performance bottlenecks in Service Stack web services especially the ones that comes out of the box like (Register) Web Service. We ran a load-test using Visual Studio Load Test with...

How do I install NUnit 3 console on Windows and run tests?

I want to run tests from a console like this (being in any directory, the DLL file can be for a different .NET version): ``` $ nunit3-console test.dll ``` I googled a lot, but can't find how to set...

servicestack read from web.config fails in production build

I need to read values from web.config ``` IAppSettings appSettings = new AppSettings(); var slackWebHookUrl = appSettings.Get<string>("slackWebHookUrl"); ``` in dev conditions it works. Bu...

ServiceStack.Redis.RedisResponseException: unknown command 'SCAN'

I registered my RedisClient in my ServiceStack app host as follows ``` container.Register<IRedisClientsManager>(c => new RedisManagerPool(conn)); container.Register(c => c.Resolve<IRedisClientsManage...

How to auto log every request in .NET Core WebAPI?

I'd like to have every request logged automatically. In previous .Net Framwork WebAPI project, I used to register a delegateHandler to do so. WebApiConfig.cs ``` public static void Register(HttpConf...

How to set TTL to List Values in ServiceStack.Redis?

I Have a List in ServiceStack.Redis that I want to set a TimeSpan to expire it. In the other word, how to call the following redis command in ServiceStack.Redis > EXPIRE ListId ttl my desired meth...

What is the difference between Aes and AesManaged

I found two class in C# related to , and example code of them MSDN provides are similar, what is the difference between these two classes? [https://msdn.microsoft.com/en-us/library/system.security....

31 Oct at 17:18

Laravel Migrate Specific File(s) from Migrations

Hi read all the included documentation here in [https://laravel.com/docs/5.4/migrations](https://laravel.com/docs/5.4/migrations). Is there a way on how to migrate a certain migration file (1 migrati...

16 Sep at 12:36

is there a null conditional operator in Vbnet?

cIn C# there is a null conditional operator `?.` (sometimes called the Elvis operator) like so: ``` var name = project?.customer?.name; ``` which doesn't fail but instead return `null` if `project`...

2 Aug at 21:24

ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'

I know there are a lot of same questions already posted in stack-overflow and tried different solutions to avoid the run-time error but None of them are working for me. [](https://i.stack.imgur.com/4...

23 Apr at 20:25

Angular 2 /4 adal-angular4 active directory authenticate to API issue

I've been following this example to access azure active directory from an angular (4) application: [https://github.com/benbaran/adal-angular4-example](https://github.com/benbaran/adal-angular4-example...

Count the Number of Tables in a SQL Server Database

I have a SQL Server 2012 database called `MyDatabase`. How can I find how many tables are in the database? I'm assuming the format of the query would be something like the following, but I don't know...

Include Nuget dependencies in my build output?

I am building a modular .NET core application that can load extensions at runtime using MEF. I have 2 projects, one is a library that I want to be able to load at runtime, then I have my main applicat...

Marshal a va_list

I have the following code: ``` [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void PanicFuncDelegate(string str, IntPtr args); private void PanicFunc(string str, IntPtr args) { ...

4 Nov at 00:53

Using ffmpeg to change framerate

I am trying to convert a video clip (MP4, yuv420p) from 30 fps to 24 fps. The number of frames is correct so my output should change from 20 minutes at 30fps to 25 minutes at 24fps. Everything else sh...

2 Aug at 16:2

NotificationCompat.Builder deprecated in Android O

After upgrading my project to ``` buildToolsVersion "26.0.1" ``` Lint in Android Studio is showing a deprecated warning for the follow notification builder method: ``` new NotificationCompat.Buil...

Passing a generic <TObject> class to a form

I can't seem to find out the answer to this through searching, so here goes.... I know that I can pass Class objects generically to other classes by utilising this type of code: Then constructing in t...

6 May at 20:45