Evaluation of method in Watch window cannot be called in this context

I'm trying to see the `DateTimeOffset` values of some objects in a collection in the Watch window. So I typed: ``` collection.Select(v => v.CreatedAt.ToString("O")) ``` Trying to evaluate this howe...

27 Aug at 16:9

How do I add a parameter to an action filter in asp.net?

I have the following filter attribute, and i can pass an array of strings to the attribute like this `[MyAttribute("string1", "string2")]`. ``` public class MyAttribute : TypeFilterAttribute { pr...

How do I install PIL/Pillow for Python 3.6?

I have a script that requires PIL to run. Other than downgrading my Python, I couldn't find anyway to install PIL on my Python 3.6 Here are my attempts: ``` pip install pil Collecting pil Could no...

27 Aug at 10:59

How to to return an image with Web API Get method

I need to return an image with a Web API Get method. The code below seems to work fine except that I get this message in the Fiddler's ImageView window, "This response is encoded, but does not claim t...

12 Jul at 02:7

Copying files to a container with Docker Compose

I have a `Dockerfile` where I copy an existing directory (with content) to the container which works fine: ``` FROM php:7.0-apache COPY Frontend/ /var/www/html/aw3somevideo/ COPY Frontend/ /var/www...

8 Nov at 18:34

Docker-Compose persistent data MySQL

I can't seem to get MySQL data to persist if I run `$ docker-compose down` with the following `.yml` ``` version: '2' services: # other services data: container_name: flask_data image: m...

23 May at 12:10

How to register multiple implementations of the same interface in Asp.Net Core?

I have services that are derived from the same interface. ``` public interface IService { } public class ServiceA : IService { } public class ServiceB : IService { } public class ServiceC : IService...

asp.net core remove X-Powered-By cannot be done in middleware

Why can I not remove X-Powered-By as part of my middleware that I am executing? I can remove it if I put in the web.config but not if I put it in the middleware. I am removing another header in the ...

2 Nov at 02:53

Drop all data in a pandas dataframe

I would like to drop all data in a pandas dataframe, but am getting `TypeError: drop() takes at least 2 arguments (3 given)`. I essentially want a blank dataframe with just my columns headers. ``` im...

26 Aug at 20:9

Pandas: convert dtype 'object' to int

I've read an SQL query into Pandas and the values are coming in as dtype 'object', although they are strings, dates and integers. I am able to convert the date 'object' to a Pandas datetime dtype, but...

29 Dec at 09:10

MissingFieldException when querying a table with ServiceStack.OrmLite ServiceStack

I'm getting a `MissingFieldException` for multiple OrmLite operations: ``` using (var db = DbFactory.Open()) { var exp = db.From<Product>(); if (filter.Field1 != null) exp.Where(w =>...

26 Aug at 20:18

Unity with ASP.NET Core and MVC6 (Core)

Unity is being developed [here](https://github.com/unitycontainer/container) but I haven't had the time to test how it plays with the ASP.NET Core framework. This solution is for the specific proble...

22 Aug at 21:53

Running NPM scripts sequentially

Let's say I have ``` "scripts": { "pre-build": "echo \"Welcome\" && exit 1", "build_logic": "start cmd.exe @cmd /k \"yo esri-appbuilder-js:widget && exit 1\"", "post_build": "start C:\\...

29 Nov at 16:16

How check if type is class?

In .Net we have `Type.IsClass` to check if a type is a class using `System.Reflection`. But in no. So, how can I check?

26 Aug at 19:46

Shuffling a string so that no two adjacent letters are the same

I've been trying to solve this interview problem which asks to shuffle a string so that no two adjacent letters are identical For example, ABCC -> ACBC The approach I'm thinking of is to > 1) It...

23 May at 12:19

How to use C struct with 2D array in C# Unity

So I have a C API with the following struct ``` typedef struct mat4f_ { float m[4][4]; } mat4f; ``` It gets passed as a parameter to one of my API functions: ``` void myFunction(const mat4f matr...

26 Aug at 17:30

How to extract a list from appsettings.json in .net core

I have an appsettings.json file which looks like this: ``` { "someSetting": { "subSettings": [ "one", "two", "three" ] } } ``` When I bu...

8 Aug at 09:21

Only sources that implement IAsyncEnumerable can be used for Entity Framework asynchronous operations

I'm implementing a Model using EF 6.1.3 and .NET Framework 4.6.1. This model is used by an ASPNET app and by an ASPNET CORE app, for that reason it uses System.Data.Entity and it is located in a sepa...

26 Aug at 16:20

IsGenericType & IsValueType missing from .Net Core?

I have this code in .Net 4.6.2 and now trying to convert into .Net core however I am getting error > Error CS1061 'Type' does not contain a definition for 'IsGenericType' and no extension method '...

22 Sep at 08:18

Use ItExpr.IsNull<TValue> rather than a null argument value, as it prevents proper method lookup

I am trying to write a unit test where I need to set up a protected method. I am using Moq for this setup. ``` _innerHandler.Protected() .Setup<Task<HttpResponseMessage>>("SendAsync", It...

26 Aug at 14:50

Debugging, Source Not Found, AsyncExtensions.cs not found

I am trying to debug a webjob on azure and I get the following error: Source Not Found, AsyncExtensions.cs not found. I am working on VS 2015 and the webjob is part of an ASP.NET MVC solution deploye...

ServiceStack CustomRegistrationFeature

I'm new in ServiceStack library. I want to write my CustomRegistrationFeature with custom field and add it to ServiceStack as a Plugin. How can I do that?

How to read webapi responses with HttpClient in C#

I have developed a small webapi which has a few actions and returns my custom class called `Response`. The `Response` class ``` public class Response { bool IsSuccess=false; string Message; ...

14 Apr at 13:57

HttpContext.Current.Session unclear behaviour boolean

I'm having a weird behaviour trying to get the value of a boolean property stored at [HttpContext.Current.Session](https://msdn.microsoft.com/en-us/library/system.web.httpcontext.session(v=vs.110).asp...

Application_BeginRequest Usage

we are trying some login operations in our ASP.NET MVC project. Our goal is : ". We wrote some code but we are inside a loop. # GLOBAL.ASAX ``` protected void Application_BeginRequest(object sen...

26 Aug at 07:1