Enumerable.Repeat for reference type objects initialization

I have a question about Enumerable.Repeat function. If I will have a class: ``` class A { //code } ``` And I will create an array, of that type objects: ``` A [] arr = new A[50]; ``` And next, ...

5 Jul at 22:24

Unhandled exception of type 'System.ApplicationException' occurred in System.Drawing.dll

I have a winforms app. In development mode, when debugging from Visual Studio .NET 2003 (Yes, I know it's old, but this is a legacy project), I get this error when I try to open a new form. In order t...

How to post a dynamic JSON property to a C# ASP.NET Core Web API using MongoDB?

How to post a dynamic JSON property to a C# ASP.NET Core Web API using MongoDB? It seems like one of the advantages of MongoDB is being able to store anything you need to in an Object type property bu...

Encrypt Redis message on Azure using ServiceStack

I have a problem where we are using ServiceStack's Redis implementation for multi server caching and messaging via server sent events. As part of our security protocol, we are required to encrypt the ...

Does .net core dependency injection support Lazy<T>

I am trying to use the generic Lazy class to instantiate a costly class with .net core dependency injection extension. I have registered the IRepo type, but I'm not sure what the registration of the L...

Pandas - Drop function error (label not contained in axis)

I have a CSV file that is as the following: ``` index,Avg,Min,Max Build1,56.19,39.123,60.1039 Build2,57.11,40.102,60.2 Build3,55.1134,35.129404123,60.20121 ``` Based off my question [here](https://...

5 Jul at 16:44

How to correctly store connection strings in environment variables for retrieval by production ASP.Net Core MVC applications

I am working on an ASP.NET Core MVC application and I am having an issue with my connection strings. I have an `ASPNETCORE_ENVIRONMENT` variable set to `Production` on my production server and my pr...

java.time.format.DateTimeParseException: Text could not be parsed at index 3

I am using Java 8 to parse the the date and find difference between two dates. Here is my snippet: ``` String date1 ="01-JAN-2017"; String date2 = "02-FEB-2017"; DateTimeFormatter df = DateTimeForm...

5 Jul at 13:56

How to pass data to controller using Fetch api in asp.net core

I post data using fetch like this in my client js scripts ``` fetch('/myarea/mycontroller/myaction', { method: 'post', body: JSON.stringify({ name: namevalue, address: addressvalue })...

5 Jul at 14:28

servicestack with asp.net core read web.config

How to read or with ServiceStack ASP.Net Core? ``` IAppSettings appSettings = new AppSettings(); appSettings.Get<string>("Hello"); ``` does not find anything.

What is .subscribe in Angular?

I'm going through angular-tour-of-heroes app, and I encountered .subscribe method in routing. Can someone explain what's going on here? Link for the app: [https://embed.plnkr.co/?show=preview](https:/...

6 Aug at 08:37

URL Encode and Decode in ASP.NET Core

``` HttpContext.Current.Server.UrlEncode ``` This does only work in .NET Framework. How can I encode or decode URI arguments in ASP.NET Core?

5 Apr at 09:47

Double quotes in c# doesn't allow multiline

e.g. ``` string str = "{\"aps\":{\"alert\":\"" + title + "" + message + "\"}}"; ``` I need to make it as for readability: ``` string str = " { \"aps\": { \"alert\":\"" + ...

5 Jul at 05:55

C# String Array Contains

Can someone explain to me why the top part of the code works but when test is an array it doesn't? ``` string test = "Customer - "; if (test.Contains("Customer")) { test = "a"; } ``` The code b...

21 Sep at 09:20

Python TypeError must be str not int

I am having trouble with the following piece of code: ``` if verb == "stoke": if items["furnace"] >= 1: print("going to stoke the furnace") if items["coal"] >= 1: ...

22 Jan at 14:33

How to add Web API controller to an existing ASP.NET Core MVC?

I created a project using the default ASP.NET Core MVC template. I would like to also create a RESTful API under `/api/{Controller}`. I added a new Web API controller (standard Web API controller clas...

Servicestack SOAP - Invalid credentials returning html in response

In my service, I have a custom auth provider that throws a HttpError if the credentials are invalid like so: ``` throw HttpError.Unauthorized("Invalid Username or Password"); ``` When I access this...

5 Jul at 11:44

Is it possible to do sub-query join using ServiceStack's OrmLite?

Is it possible to do sub-query join using ServiceStack's OrmLite? Something like this? ``` var q = Db.From<Customer>() .Join<Customer, subq>((c, subq) => c.CustomerID == subq.CustomerID) ```

7 Jul at 02:16

DateTime.Now vs system time

Let's imagine that this little program runs: ``` while (true) { Console.WriteLine($"{DateTime.UtcNow} -> {DateTime.Now} tz={TimeZone.CurrentTimeZone.StandardName} / {TimeZoneInfo.Local.StandardNa...

4 Jul at 07:3

This site can't be reached error

I have an `asp.net` MVC project developed in VS2015. Now I try to run it in VS2017 and get an error: > This site can't be reached. What can I do with this trouble?

add servicestack.core to .net core library

In servicestack angular 2 seed project services is in different solution which is helpful. But for some reason cannot install servicestack.core fails to add to .net core class library. Is it even poss...

3 Jul at 18:58

Setting custom <OutputPath> in .NET Core (stop adding framework target)?

In traditional .NET applications, it was possible to set a custom `<OutputPath>` of an assembly in the `.csproj` file (or via the project properties dialog). A path of e.g. `bin\$(Configuration)\$(Pla...

How to have an optional file that gets copied to the output directory in VS 2017?

On a large (team and code) project, we have set up the various `App.config`s and `Web.config`s to reference an (optional) `local.config` file so that developers can override some things when running l...

3 Jul at 17:1

DirectoryNotFoundException when using long paths in .NET 4.7

I have set `Enable Win32 Long Paths` in the to `Enabled` and restarted the computer. And here's the code: ``` string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); for (int i = ...

15 Jul at 17:31

How to run "brew" command in windows..?

It shows "" in windows command prompt. [](https://i.stack.imgur.com/suFT2.png) I am trying to install [codeigniter-reactjs-example](https://github.com/makasimenator/codeigniter-reactjs-example) from...