Could not load type 'System.IdentityModel.Tokens.JwtSecurityToken'

I have two libraries. One consumes the other and the consuming library is is itself used by a Web app. The Web app returns the error below whereas the code instantiating the type ( doping JWT signatur...

7 May at 05:53

Service stack how to dynamically register types which are from different assemblies

I have registered following types with IOC (func) in App host.Classes & interfaces given below are in a separate class library .This class library contains a WCF service reference . ``` private void ...

servicestack userauthid is type of string but it actually is int

Is there any cases where IAuthSession.UserAuthId is something else than int or can I just safely assume it is always int?

31 Jul at 13:59

What is the reason that Encoding.UTF8.GetString and Encoding.UTF8.GetBytes are not inverse of each other?

Probably I am missing something, but I do not understand why Encoding.UTF8.GetString and Encoding.UTF8.GetBytes are not working as inverse transformation of each other? In the following example the m...

31 Jul at 07:53

What is the difference between these two variations of collection initialiser expressions?

I've been using C# for a while, but recently noticed that the behaviour of one of my unit tests changed depending on which variation of collection initialiser expression I used: - `var object = new C...

31 Jul at 07:32

.NET Core how to unit test service?

I have build a WebAPI and want to create a unit test project to have my services tested automatically. The flow of my WebAPI is simple: Controller (DI Service) -> Service (DI Repository) -> _repo CR...

31 Jul at 07:42

Implement IDbConnection in .Net Core

I have a .Net core web application and .net core library. When using Dapper, I need to pass in a concrete class that inherits from `IDbConnection`. The problem is that in .Net Core `System.Data` is no...

How to perform string interpolation in TypeScript?

C# uses string interpolation ``` int value = 100; Console.WriteLine($"The size is {value}."); ``` Output: > The size is 100. How to do the same thing in TypeScript?

Customizing Increment Arrows on Input of Type Number Using CSS

I have an input of type number that is rendered using the following code: `<input class="quantity" id="id_form-0-quantity" min="0" name="form-0-quantity" value="1" type="number">` It looks like this...

30 Jul at 21:25

Post Array Json to .net core web api controller

I have this code and this json and everything is going ok. But if i want to send a json array I get an exception > Object reference not set to an instance of an object. ". I tried with List or or but ...

30 Aug at 07:5

How to Pass Parameters to screen in StackNavigator?

My React Native code: ``` import React, { Component } from 'react'; import { AppRegistry, ActivityIndicator, StyleSheet, ListView, Text, Button, TouchableHighlight, View } from 'react-native'; i...

29 Jul at 11:51

ServiceStack Razor with Multiple SPAs

I don't see an example of using ServiceStack Razor with Multiple SPAs on the internet. The reason for having multiple SPAs in my use case is because my entire site is quite huge and I would like to mo...

Read and Write to the clipboard

I have this snippet on Windows (VS2017 Community) on Unity 5.6: ``` public static void setClipboardStr(string str) { try { if (Clipboard.ContainsText()) { // ...do...

30 Jul at 03:5

How to execute a python script in a different directory?

see my answer below for anyone who might find this helpful. I have two scripts a.py and b.py. In my current directory "C:\Users\MyName\Desktop\MAIN", I run > python a.py. The first script, a.py run...

29 Jul at 02:15

Unable to load DLL 'sni.dll' - Entity Framework Core

When using Entity Framework Core in an ASP.Net Core application on Visual Studio 2017 I intermittently get the error "Unable to load 'sni.dll'. Strangely though I have found a temporary fix: restarti...

Update .NET web service to use TLS 1.2

I need to use TLS 1.2 to connect from my .NET web service to another that is going to force TLS 1.2. I found a resource that said .NET 4.6 uses TLS 1.2 by default so that sounded like the easiest sol...

28 Jul at 20:53

select rows in sql with latest date for each ID repeated multiple times

I have a table where each ID is repeated 3 times. there is a date in front of each id in each row. I want to select entire row for each ID where date is latest. There are total 370 columns in this ta...

28 Jul at 20:16

dotnet core : Can not find assembly file Microsoft.CSharp.dll

I have a project that i have not run for some while, build with dotnet core 1.1.2 dependencies. in the meanwhile I have updated visual studio, possible installed some dotnet core stuff for 2.0 and my...

28 Jul at 19:6

Alternative to using ref in foreach?

I have a modifying method with a signature like ``` private bool Modify(ref MyClass obj); ``` that will make modifications to `obj` and indicate succes with it's return value. `Modify` is not reass...

28 Jul at 19:27

Is it possible to bind configuration to stateless/readonly model in .NET Core?

Normally, we would have some model ``` public class ConnectionStrings { public string Sql { get; set; } public string NoSql { get; set; } } ``` then we have something in `appsettings.json` ...

29 Apr at 07:49

Sharing Cookie between different ports

I have an application1(C#) that is hosted on port:80 and application 2(nodejs) that is hosted on port:3030. Both are on localhost. - - - - - - In Application 1 (its using System.Web.HttpCooki...

28 Jul at 16:9

An assembly specified in the application dependencies manifest was not found:

I developed application in asp.net-core 2.0 preview1. I developed on windows with Visual Studio 2017. Now I want to deploy it to Linux server using Docker. I created Docker file: ``` FROM microsoft...

28 Jul at 15:33

Selenium Chrome 60 Headless Handle Basic Authentication SAML Dialog over HTTPS

Chrome 59 [removed support for https://user:password@example.com URLs](https://www.chromestatus.com/feature/5669008342777856). I have a C# selenium test that needs to work with [Chrome Version 60 on ...

Detect Route Change with react-router

I have to implement some business logic depending on browsing history. What I want to do is something like this: ``` reactRouter.onUrlChange(url => { this.history.push(url); }); ``` Is there an...

Difference between @click and v-on:click Vuejs

The questions should be enough clear. But I can see that someone use: ``` <button @click="function()">press</button> ``` Someone use: ``` <button v-on:click="function()">press</button> ``` But reall...

31 Oct at 02:3