how to get publish version?

I would like to show the publish version of my desktop application. I am trying to do it with this code: ``` _appVersion.Content = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version...

27 Sep at 10:52

What is the difference between json.load() and json.loads() functions

In Python, what is the difference between `json.load()` and `json.loads()`? I guess that the function must be used with a file object (I need thus to use a context manager) while the function take ...

28 Oct at 17:45

IDbAsyncQueryProvider in EntityFrameworkCore

I'm using XUNIT to test in a dot net core application. I need to test a service that is internally making an async query on a DbSet in my datacontext. [I've seen here](https://msdn.microsoft.com/en-...

Visual studio code - keyboard shortcuts - expand/collapse all

Trying to find the equivalent to + + in Intellij that collapses/expands all functions.

2 Sep at 09:59

Why is System.Net.Http.HttpMethod a class, not an enum?

`HttpStatusCode` is implemented as an `enum`, with each possible value assigned to its corresponding HTTP status code (e.g. `(int)HttpStatusCode.Ok == 200`). However, `HttpMethod` is [implemented as a...

19 Jan at 19:20

Exception : The given filter must implement one or more of the following filter interfaces when implementing custom filter in WebAPI 2

I am trying to build my custom filter for authentication, but I am running on this problem when I try to run my WebAPI solution: > The given filter instance must implement one or more of the followin...

27 Sep at 06:17

Getting a UnhandledPromiseRejectionWarning when testing using mocha/chai

So, I'm testing a component that relies on an event-emitter. To do so I came up with a solution using Promises with Mocha+Chai: ``` it('should transition with the correct event', (done) => { const c...

Check if dateTime is a weekend or a weekday

``` <script Language="c#" runat="server"> void Page_Load() { DateTime date = DateTime.Now; dateToday.Text = " " + date.ToString("d"); DayOfWeek day = DateTime.Now.DayOfWeek; dayToday.T...

27 Sep at 23:56

c# parallel foreach loop finding index

I am trying to read all lines in a text file and planning to display each line info. How can I find the index for each item inside loop? ``` string[] lines = File.ReadAllLines("MyFile.txt"); List...

21 Feb at 16:33

asp.net - image keywords missing after uploading image to server

I'm uploading image to server and then processing the image. Funny thing is, after uploading the image image keywords are missing. Although other image properties are there. [](https://i.stack.imgur....

3 Aug at 09:46

Can I/Should I add authentication providers at runtime using Servicestack

I have a multi-tenant, microservice application using ServiceStack for everything but the front end in which we have several types of clients, mostly cordova based. We have a request from different cl...

26 Sep at 18:40

Connecting UWP apps hosted by ApplicationFrameHost to their real processes

I am working on an WPF application to monitor my activities on my computer. I use `Process.GetProcesses()` and some filtering to get the processes I am interested in (example:Calculator) then I record...

6 Oct at 18:11

Best practice for persisting tokens using Client Credentials flow

I have an ASP.NET Core MVC application allowing anonymous users. This app is calling an ASP.NET Web API that is protected by Identity Server 4. I have created a client in Identity Server describing th...

7 May at 03:58

Combine string interpolation and string.format

I'm just wondering if there is a possibility to combine string interpolation, which was introduced in C# and `string.Format`? Any smarter ideas like this?

7 May at 02:12

The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. laravel 5.3

I installed a new fresh copy of Laravel 5.3 using composer but I'm getting this error: > The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. Even though my app....

23 Apr at 08:29

Service Stack Basic Auth Routes only accesible from localhost?

I'm using service stacks basic auth plugin. When I access any of the auth routes it adds like /register, or /auth from the machine the service is running on (localhost) the routes work fine. When I a...

26 Sep at 00:21

LINQ to Entities does not recognize the method: LastOrDefault

Overview: In CompletedQuestions table, UserId corresponds to the user which completed that question. Id property corresponds to one of the questions in the Questions table. I know, i didn't specify re...

Error: Cannot invoke an expression whose type lacks a call signature

I am brand new to typescript, and I have two classes. In the parent class I have: ``` abstract class Component { public deps: any = {}; public props: any = {}; public setProp(prop: string): an...

17 Jul at 14:45

How to format LocalDate object to MM/dd/yyyy and have format persist

I am reading text and storing the dates as LocalDate variables. Is there any way for me to preserve the formatting from DateTimeFormatter so that when I call the LocalDate variable it will still be ...

25 Sep at 17:59

How to make a dynamic order in Entity Framework

I have a dictionary declared like this: ``` private Dictionary<string, Expression<Func<Part, object>>> _orders = new Dictionary<string, Expression<Func<Part, object>>>() { {"Name", x => x...

25 Sep at 12:14

Angular 2 : No NgModule metadata found

I'm brand new to Angular 2 and attempting to follow along with a video tutorial I found. Despite following all of the steps, Angular just won't work; I get the following error: ``` compiler.umd.js:13...

7 Jul at 01:28

Docker for Windows error: "Hardware assisted virtualization and data execution protection must be enabled in the BIOS"

I've installed Docker and I'm getting this error when I run the GUI: > Hardware assisted virtualization and data execution protection must be enabled in the BIOS Seems like a bug since Docker work...

25 Sep at 08:45

How to achieve remove_if functionality in .NET ConcurrentDictionary

I have a scenario where I have to keep reference counted object for given key in the `ConcurrentDictionary`, if reference count reaches `0`, I want to delete the key. This has to be thread safe hence ...

Angular 2 Form "Cannot find control with path"

I try to make a dynamic form (so you can limitless add items to a list), but somehow the content of my list is not getting send because it can't find the control with path: > Cannot find control with ...

22 Dec at 09:47

Average value of list

I want to make code that will on the first click start `rotorSpeed` stopwatch then on the second click add `rotorSpeed.ElapsedMilliseconds` to `list`. On the second click resets stopwatch and starts t...

16 Aug at 16:46