Hangfire DistributedLockTimeoutException when calling the same static method concurrently

I have a web service that, when posted to, queues up downloads of images in Hangfire, so that if the image download fails, Hangfire will automatically retry: ``` [AutomaticRetry(Attempts = 5, OnAttem...

19 Jan at 08:13

Unit testing a Web API controller

I am fairly new to unit testing and I am trying to create a unit test for a Web API contoller that I have created which returns a list of brands. My Web API controller `Get()` method looks like this:...

Intellisense deleting code as I type

Intellisense (or Resharper) is occasionally deleting my C# code as I write it. It's occuring in declarations and in method calls, and seems to be triggered by a comma or open bracket. The Undo history...

Find non-awaited async method calls

I've just stumbled across a rather dangerous scenario while migrating an ASP.NET application to the async/await model. The situation is that I made a method async: `async Task DoWhateverAsync()`, cha...

18 Jan at 15:57

Unity - IEnumerator's yield return null

I'm currently trying to understand IEnumerator & Coroutine within the context of Unity and am not too confident on what the "yield return null" performs. At the moment i believe it basically pauses a...

19 Jan at 11:10

Docker-compose container using host DNS server

I'm running several containers on my "Ubuntu 16.10 Server" in a "custom" bridge network with compose 2.9 (in a yml version 2.1). Most of my containers are internally using the same ports, so there is ...

21 May at 13:50

Handle variable number of out parameters with less code duplication in C#

I'm trying to write a function that populates strings with the contents of an array, or sets them to null. The number of strings is can vary and I don't want to add requirements like them all being pa...

23 May at 11:53

Git how to clone with SSH key, username

I have the following and i need to clone the repository in either windows terminal command prompt or linux. - - - I tried as : ``` git clone git@xxxxx.com:xxx/xxx/git ``` I get ``` Permission denied...

18 Jul at 14:52

Programmatically change custom mouse cursor in windows?

I am trying to change the windows cursors (the default is Windows Custom Scheme) to my custom cursors (It named Cut the rope): [](https://i.stack.imgur.com/HAsnz.png) Is there any idea to change al...

10 Jan at 04:49

Include pdb files into my nuget (nupkg) files

I am using MSBuild to generate my nuget packages. Is there any command I need to set, to allow it to include my `.pdb` files, for stepping into the source while debugging? I do not want the source f...

18 Jan at 07:35

What are advantages of capturing the Infomessages of SQL connections?

I'm currently reviewing/redoing code of a collegue of mine and stumbled upon a construct I've never seen done before: ``` con = new SqlConnection("Data Source=....."); con.FireInfoMessageEventOnUserE...

18 Jan at 08:7

Entity Framework Core cascade delete one to many relationship

``` public class Station : IEntitie { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } public virtual ICollection<RegulatorySchedule> Regulatory...

Keras, How to get the output of each layer?

I have trained a binary classification model with CNN, and here is my code ``` model = Sequential() model.add(Convolution2D(nb_filters, kernel_size[0], kernel_size[1], border_...

Create directory async (without using FileSystemWatcher)?

How can I make make the following code run asynchronously without having to create an extra thread on the thread pool (in other words without `Task.Run(...)`)? ``` Directory.CreateDirectory("\\host\...

18 Jul at 12:30

Assembly Binding Error: Unrecoverable error occurred during pre-download check (hr = 0x80070780)

I have a .NET 4.5 application that works and runs with no issues in most environments; however, one area of the application throws a runtime assembly reference error on some client machines: ``` Coul...

Build .Net Core as an EXE not a DLL

I want to build a .NET Core project as a EXE and not a DLL so it can be executed. The answer here did not work: [How to run a .Net Core dll?](https://stackoverflow.com/questions/36516848/how-to-run-...

17 Jan at 19:32

Entity Framework Core creating model from existing database

With Entity Framework Core, how do you generate the EF model and the entities? According to [ASP.NET Core - Existing Database](https://learn.microsoft.com/en-us/ef/core/get-started/aspnetcore/existin...

ASP.NET MVC Controller SubFolder

I am using ASP.NET MVC and trying to create a controller subfolder. I have looked at other post on this site and tried what I was able to find online, but it still running into this issue: ``` HTTP 4...

17 Jan at 17:43

How to read/write files in .Net Core?

What are the options to read/write files in .Net Core? I am working on my first .Net Core app and looking for `File.Read*`/`File.Write*` functions (`System.IO` from `.Net`) alternatives.

13 Apr at 05:12

Using media breakpoints in Bootstrap 4-alpha

In Bootstrap 3 I use this: ``` .something { padding: 5px; @media screen and (min-width: $screen-sm-min) { padding: 20px; } @media screen and (min-width: $screen-md-min) { ...

Event sourcing incremental int id

I looked at a lot of event sourcing tutorials and all are using simple demos to focus on the tutorials topic (Event sourcing) That's fine until you hit in a real work application something that is no...

17 Jan at 14:17

"C:\Microsoft.Cpp.Default.props" was not found

I have a project created in Visual Studio, 2013. The project file has the following properties: ToolsVersion="12.0", PlatformToolset = v120. I have Visual Studio 2013 and Microsoft Build Tools 2...

Custom seekbar (thumb size, color and background)

I would like to have this seekbar in my Android project : [](https://i.stack.imgur.com/M1ylD.png) This is my seekbar : ``` <SeekBar android:id="@+id/seekBar_luminosite" android:layou...

25 Oct at 18:49

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)

I am trying to use the betbrain.py from Github ([https://github.com/gto76/betbrain-scraper](https://github.com/gto76/betbrain-scraper)) that has the following code: ``` #!/usr/bin/python3 # # Usage: b...

1 May at 17:13

How to change git account in Git bash?

I have weird problem with Git bash. I have two Github accounts, let's say and . I set my name and email, like in account A: ``` git config --global user.name git config --global user.email ``` I...

19 Jun at 16:16