Questions

serilog format SourceContext for showing only assembly name

I configured my project to use Serilog for logging using dependecy injection. I use the following schema in the classes constructor: ``` namespace FlickPopper.API.Controllers { public class Val...

26 Jan at 21:57

How to view instagram profile picture in full-size?

I was able to view and download a person's full sized, high resolution profile picture on Instagram until even a few days ago. I usually remove the 's150x150' from the URL and it worked fine for me. B...

22 Aug at 18:31

Shortcut to instantiate an object in Visual Studio

I have a class with more than 8 properties, and I often want to instantiate it in some method, but it is super tedious to have to write the properties one by one to assign them the value. Is there a...

26 Jan at 15:39

How to display 3 items per row in flexbox?

I have a list and I want to display my `li` elements horizontally and 3 per row. I've been trying to get what I want, but no luck. Is there a solution? ``` <div class="serv"> <ul> ...

26 Jan at 16:29

How can I run selenium chrome driver in a docker container?

# tl;dr How can I install all the components to run Selenium in a docker container? --- # Question I'm starting with this image: ``` FROM microsoft/aspnetcore-build:2 AS builder WORKDIR ...

How to include only selected properties on related entities

I can include only related entities. ``` using (var context = new BloggingContext()) { // Load all blogs, all related posts var blogs1 = context.Blogs .Include(b => ...

26 Jan at 14:10

How to detect if debugging

I have a .Net Core console application. In the configure method in my startup.cs I am trying to test if the debugger is enabled or not: ``` if (HttpContext.Current.IsDebuggingEnabled) loggerFact...

29 Jan at 07:42

How to set shadow effect on ImageView

I'm tryin' to set shadow on an Image view on Xamarin.Forms (targeting the Android platform) and I got some examples on the internet. The PCL code is quite simple, and the platform seemed pretty easy...

Functions are not valid as a React child. This may happen if you return a Component instead of from render

I have written a Higher Order Component: ``` import React from 'react'; const NewHOC = (PassedComponent) => { return class extends React.Component { render(){ return ( ...

(VS2017) There was an error running the selected code generator: 'Sequence contains no elements'

I'm running through [one of Microsoft's tutorial](https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/)s on MVC development and I'm getting errors when trying to create various eleme...

IWebHost: Calling Run() vs RunAsync()

When a new ASP.NET Core 2.0 project is created, the boilerplate `Main` method in the `Program` class looks something like this: ``` public static void Main(string[] args) { BuildWebHost(args).Run...

Spring 5.0.3 RequestRejectedException: The request was rejected because the URL was not normalized

Not sure if this is a bug with Spring 5.0.3 or a new feature to fix things on my end. After the upgrade, I am getting this error. Interestingly this error is only on my local machine. Same code on te...

15 Apr at 11:42

ASP.NET Core - Swashbuckle not creating swagger.json file

I am having trouble getting the Swashbuckle.AspNetCore (1.0.0) package to generate any output. I read the swagger.json file should be written to '~/swagger/docs/v1'. However, I am not getting any ou...

20 Nov at 09:0

Why does this very simple C# method produce such illogical CIL code?

I've been digging into IL recently, and I noticed some odd behavior of the C# compiler. The following method is a very simple and verifiable application, it will immediately exit with exit code 1: ``...

25 Jan at 14:58

Is there a way to remove the increase/decrease arrows in input type="number" for textboxfor?

Is there any way to remove these in input (type="number")? ``` <input type="number" /> ``` It's for the users to input their phone numbers. [this](https://i.stack.imgur.com/YD7Wn.png)

4 Feb at 13:35

Nested queries in ORMLite c#

I was wondering about doing nested queries using `ORMLite`. I need it to reduce the cardinality of a table in order to have a lighter join. Basically, I'd need something to build the following `SQL s...

25 Jan at 14:26

Multi-Context InMemory Database

Is it possible to have an InMemory database (ASP.NET Core) that is shared across multiple DbContexts? It seems that each DbContext type keeps its own database, even when the same database name is spec...

ServiceStack Razor Local Time

ServiceStack Razor page display time is UTC, How to display a Local time? Code in Backstage: ServiceModel.Types ``` public class Customer { public int Id { get; set; } public DateTime Crea...

25 Jan at 06:8

ReferenceError: fetch is not defined

I have this error when I compile my code in node.js, how can I fix it? RefernceError: fetch is not defined [](https://i.stack.imgur.com/3Syvz.png) This is the function I am doing, it is responsible...

7 Jul at 15:43

Removing broken packages in Ubuntu

There was an error when I tried to remove a package, so it was left in a broken state. I tried the following: ``` sudo dpkg --remove --force-remove-reinstreq rvm ``` Output: ``` (Reading database ...

24 Jan at 20:51

custom keys in appSettings.json not working in ASP.NET Core 2.0

I added a CustomSettings section keys in appSettings.json in ASP.NET Core project: I've not been able to load Culture key in following controller: No matter if I do following, always they return NULL:...

6 May at 06:10

Quartz.net CancellationToken

In my scheduler, implemented with quartz.net v3, i'm trying to test the behaviour of the cancellation token: ``` .... IScheduler scheduler = await factory.GetScheduler(); .... var tokenSource = new C...

27 May at 12:42

DotNet Core .csproj code files as child items

I am migrating an old .NET Framework csproj to dotnet core. What is the dotnet core equivalent of this: ServiceHost.cs I tried: ServiceHost.cs But I got this error: > Duplic...

6 May at 07:20

Youtube - downloading a playlist - youtube-dl

I am trying to download all the videos from the [playlist](https://www.youtube.com/watch?v=7Vy8970q0Xc&list=PLwJ2VKmefmxpUJEGB1ff6yUZ5Zd7Gegn2): I am using youtube-dl for this and the command is: `...

22 Aug at 14:16

Get name of branch into code

I have a question about passing the branch name to my code as a string. So we are using a git repository and the branch number also refers to the staging environment where the build is placed. Mean...

3 May at 18:32