Email attachment with long non-ascii name

I try to send `System.Net.Mail.MailMessage` with `System.Net.Mail.Attachment`. Name of attachment is "Счёт-договор №4321 от 4 июля.pdf" Code for attachment creation: ``` var nameEncoding = Encodin...

PM2 command not found

I installed node.js and npm to my centOS 7 server. But i have problems with pm2. Actually real problem is i don't have experiences in linux and i don't know how to change path. Here is folder structur...

4 Jul at 13:21

How to add IHttpContextAccessor in the Startup class in the DI in ASP.NET Core 1.0?

In ASP.NET Core RC 1 I used the following code to retrieve the value of context (full address of the page). Then I recorded this value in the configuration. ``` public class Startup { public I...

.net core 1.0 visual studio referencing external dll

with the release of the .net core i have been trying to build a simple project, however whenever i try and add a dll reference in my project i get the following message "" i was getting this messag...

4 Jul at 11:29

How to automatically populate CreatedDate and ModifiedDate?

I am learning ASP.NET Core MVC and my model is ``` namespace Joukyuu.Models { public class Passage { public int PassageId { get; set; } public string Contents { get; set; } ...

How to resolve un-registered type using standard MVC Core dependency injection

Is there a way to get `IServiceProvider.GetService<T>` to return an instance even if `T` is not explicitly registered with the container? If I know that `T` has dependencies I'd like them to be injec...

Read Json data from text file C#

I have a text file with below format data ``` [ { "SponsorID": 1, "FirstBAID": 7395836 }, { "SponsorID": 2, "FirstBAID": 3509279, "SecondBAID": 29...

4 Jul at 08:15

Is there any way to debug chrome in any IOS device

Is there any way to debug chrome browser on IOS device? If there is no way, how i can approach to bug in chrome on ios? Searched the web and didn't find sufficient answer.

How to log state transitions in Stateless (.NET state machine library)

I would like to have a log in database of state transitions of my workflow. Where is the best place to trigger logging with [Stateless](https://github.com/dotnet-state-machine/stateless)? Should it b...

4 Jul at 07:14

Converting bool expression to char in c#

I passed .NET quiz, when I met a question like below one. ``` Char ch = Convert.ToChar('a' | 'e' | 'c' | 'a'); ``` In console we can see that output for `ch` variable is `g`. Can someone describe ...

4 Jul at 06:53

How can I ensure that appsettings.dev.json gets copied to the output folder?

I have three configuration files, one for each environment: 1. appsettings.json -> production 2. appsettings.dev.json -> development 3. appsettings.stg.json -> staging If I set to , I get a runt...

Javascript Map Array Last Item

I have this: ``` map = ranks.map((row, r) => ( row.map((rank, i) => { return [element(r, i, state, rank, toggled, onClick)]; }) )); ``` It maps through a 2-dimentional array. After each row...

Servicestack RedisClient staying connected after being disposed

I am using servicestack for my redisclient in my class. I have one redis client as the following: ``` public class MySuperClass{ .... RedisClient client = new RedisClient("localhost",...

4 Jul at 02:46

Angular 2 Date Input not binding to date value

trying to get a form set up but for some reason, the Date input in my html is not binding to the object's date value, despite using [(ngModel)] html: ``` <input type='date' #myDate [(ngModel)]='demo...

The program '[13492] dotnet.exe' has exited with code -2147450749

When trying to build and run a hello world dotnetcore console app the app closes without any exceptions. On the debug output I see the following. > The program '[13492] dotnet.exe' has exited with co...

3 Jul at 23:30

Injecting Service in Middleware in ASP.NET Core

I want to inject a service based on the HTTP header value. So I have 2 classes - DbDataProvider and InMemDataProvider, both are implemented from IDataProvider. Whenever an API call is made, a header i...

Group dataframe and get sum AND count?

I have a dataframe that looks like this: ``` Company Name Organisation Name Amount 10118 Vifor Pharma UK Ltd Welsh Assoc for Gastro & Endo 2700.00 10119 Vifor Pharma UK Ltd Welsh ...

"No ESLint configuration found" error

Recently, we've upgraded to [ESLint 3.0.0](http://eslint.org/blog/2016/07/eslint-v3.0.0-released) and started to receive the following message running the `grunt eslint` task: ``` > $ grunt eslint Ru...

How to select specific columns in laravel eloquent

lets say I have 7 columns in table, and I want to select only two of them, something like this ``` SELECT `name`,`surname` FROM `table` WHERE `id` = '1'; ``` In laravel eloquent model it may looks ...

28 Apr at 16:39

static property in c# 6

I'm writing a small code to more understand about `property` and `static property`. Like these: ``` class UserIdentity { public static IDictionary<string, DateTime> OnlineUsers { get; set; } ...

3 Jul at 14:37

HttpContext.Current is null when unit test

I have following web Api controller method. When I run this code through web, `HttpContext.Current` is `never null` and give desired value. ``` public override void Post([FromBody]TestDTO model) { ...

3 Jul at 14:26

Cross-platform file name handling in .NET Core

How to handle file name in `System.IO` classes in a cross-platform manner to make it work on Windows and Linux? For example, I write this code that works perfectly on Windows, however it doesn't crea...

1 Mar at 17:1

C# bool is atomic, why is volatile valid

In , we know that a `bool` is atomic - then why is it valid to mark it as `volatile`? what is the difference and what is a good (or even practical) use-case for one versus the other? ``` bool _isPend...

C#: ASP.NET WebApi default route to index.html

I am trying to create an Asp.net WebApi / Single Page Application. I would like my server to dispense index.html if no route is given. I would like it to use a controller when one is specified in the ...

16 May at 18:42

Python regex match space only

In python3, how do I match exactly whitespace character and not newline \n or tab \t? I've seen the `\s+[^\n]` answer from [Regex match space not \n](https://stackoverflow.com/questions/14190038/re...

23 May at 11:58