How to force Newtonsoft Json to serialize all properties? (Strange behavior with "Specified" property)

Fellow programmers, I've encountered a strange behavior in Newtonsoft.Json. When I'm trying to serialize an object looking like this: ``` public class DMSDocWorkflowI { [JsonProperty("DMSDocWork...

30 Aug at 09:23

Multiple RUN vs. single chained RUN in Dockerfile, which is better?

`Dockerfile.1` executes multiple `RUN`: ``` FROM busybox RUN echo This is the A > a RUN echo This is the B > b RUN echo This is the C > c ``` `Dockerfile.2` joins them: ``` FROM busybox RUN echo This...

24 Dec at 01:26

Maximum number of Threads available to Tasks

I'm Trying to get my head around the async-await functionality within C#. I've written the below code to run several tasks asynchronously - currently all they do is raise an event after a certain amou...

Method Overloading with Optional Parameter

I have a class as follows with two overload method. ``` Class A { public string x(string a, string b) { return "hello" + a + b; } public string x(string a, string b, string c...

30 Aug at 05:36

Get Name of User from Active Directory

I need to show only the name of a user from Active Directory, I am using ``` lbl_Login.Text = User.Identity.Name; //the result is domain\username ``` This shows the users name but not the real nam...

2 Feb at 15:36

Export the dataGridView to Excel with all the cells format

I have this code that I know that it works fast ``` CopyAlltoClipboard(dataGridViewControl); Microsoft.Office.Interop.Excel.Application xlexcel; Microsoft.Office.Interop.Excel.Workbook xlWorkBook; Mi...

Bind UWP ComboBox ItemsSource to Enum

It's possible to use the `ObjectDataProvider` in a WPF application to bind an enum's string values to a ComboBox's ItemsSource, as evidenced in [this question](https://stackoverflow.com/questions/6145...

23 May at 12:10

How to override Custom Papersize in C#

I'm working on a project in C#. I have a labelprinter which needs to print a document that I send. The printer prints, however, I'm not able to override the following values of the `Custom` Paper form...

20 Oct at 08:30

Is this the proper way to convert between time zones in Nodatime?

The goal is to create a function that converts a time from one timezone to another properly using Nodatime. I'm not just looking for feedback on whether the result appears correct, but feedback speci...

29 Aug at 20:25

How to secure generated API documentation using swagger swashbuckle

I have implemented API documentation using swagger swashbukle. Now I want to publish generated documentation as a help file in my website. How to secure this link and publish?

How many bytes get allocated for 3 Point structs on a 64-bit processor?

There is a question: > Given:``` struct Point {int x; int y;} var p = new Point[3] ``` how many bytes of memory will be allocated in stack and in heap if we use a 64-bit processor? The correct answer ...

20 Jun at 09:12

How to Use MVC Controller and WebAPI Controller in same project

I am trying to use an MVC Controller and a Web API controller in the same project, but I get 404 errors for the Web API. I started the project as an MVC project in VS 2015, but then added the Web API ...

What is the equivalent of [Serializable] in .NET Core ? (Conversion Projects)

In many cases, when I want to convert current .NET Framework projects to .NET Core equivalent, some classes have . What should I do for convert them in .NET Core ? (In this time I delete them !!!) ...

29 Aug at 05:45

Linq performance: should I first use `where` or `select`

I have a large `List` in memory, from a class that has about 20 `properties`. I'd like to filter this list based on just one `property`, for a particular task I only need a list of that `property`. ...

No assembly found containing an OwinStartupAttribute Error

This error The following errors occurred while attempting to load the app. - No assembly found containing an OwinStartupAttribute. - The given type or method 'false' was not found. Try specifying th...

29 Aug at 02:50

laravel 5.3 new Auth::routes()

Recently I start to use laravel 5.3 to write a blog, but I have a question after run `php artisan make:auth` when I run this, it will generate routes in my `web.php` this is the code in it: ``` Aut...

29 Aug at 01:10

Equivalent of the method RSACryptoServiceProvider signHash in Java

I'm trying to get the equivalent of the following C# method : ``` public byte[] SignHash(byte[] btHash, string SN) { string strSignature = string.Empty; X509Store x509store = null; x509st...

23 May at 12:0

Setting a backgroundImage With React Inline Styles

I'm trying to access a static image to use within an inline `backgroundImage` property within React. Unfortunately, I've run up dry on how to do this. Generally, I thought you just did as follows: ```...

10 Aug at 20:45

'gulp' is not recognized as an internal or external command

I am trying to use [Gulp](http://gulpjs.com/) and [Node.Js](https://nodejs.org/en/) to stream my process for minifying and concatenating CSS/JS files for production. Here is what I have done. 1. I ...

23 May at 19:57

How to compress a Byte array without stream or system io

I'm trying to encode an image into a byte array and send it to a server. the encoding and sending parts wok fine but my problem is that the byte array is too large and takes too long to send so I thou...

28 Aug at 13:48

C# async within an action

I would like to write a method which accept several parameters, including an action and a retry amount and invoke it. So I have this code: ``` public static IEnumerable<Task> RunWithRetries<T>(List<...

28 Aug at 17:5

Cannot find module 'eslint-config-defaults/configurations/eslint'

I am new to working with the light version of Visual Studio Code and for the life of me I cannot figure out how to resolve this error. I've tried to pull in any type of file the even closely resemble...

28 Aug at 11:42

How to get object using Httpclient with response Ok in Web Api

my web api like ``` public async Task<IHttpActionResult> RegisterUser(User user) { //User Implementation here return Ok(user); } ``` I am using HTTPClient to request web a...

How to run code after a delay in Xamarin Android

I'm trying to show some code after a delay in my Android app. The Java code for doing this is something like this: ``` new Handler().postDelayed(new Runnable() { @Override public void run() ...

Enable SSL in Visual Studio

I have enabled SSL in Visual Studio as shown below: [](https://i.stack.imgur.com/x6Qx3.png) I have also set the below: [](https://i.stack.imgur.com/3w6VH.png) When I access the website via IE (via...

27 Aug at 17:17