ASP.NET/ServiceStack Root URL at startup
I'm trying to setup a ServiceStack template loosely based on the existing ASP.NET with razor template. The services to be created using this will be hosted in a variety of locations. What I would like...
- Modified
- 19 Jan at 09:33
EntityFramework insert speed is very slow with large quantity of data
I am trying to insert about 50.000 rows to MS Sql Server db via Entity Framework 6.1.3 but it takes too long. I followed [this answer](https://stackoverflow.com/a/5942176/2956448). Disabled AutoDetect...
- Modified
- 23 May at 12:34
How to throw an exception in an async method (Task.FromException)
I just discovered that, since .NET 4.6, there is a new method [FromException](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.fromexception) on the `Task` object, and I was wo...
- Modified
- 18 May at 01:39
Why can't I change my input value in React even with the onChange listener
I am quite new to React and after going through some tutorials, I was trying the below code of mine. I made one component, passed props to it from a store, on `componentWillMount` I make a new state f...
- Modified
- 27 Aug at 18:18
TempData null in asp.net core
I am trying to use TempData in asp.net core However I am getting a null value on the get method of TempData. Can anyone please let me know how can I use TempData in asp.net core Below are the things ...
- Modified
- 25 Jan at 11:19
Handle DTOs with interior objects when posting a file with request DTO to a server in servicestack
I am trying to pass both a file and a request DTO to servicestack using `JsonServiceClient` and it's `PostFileWithRequest<ResponseType>(fileStream, fileName, RequestType)` function. The issue arises...
- Modified
- 19 Jan at 02:8
GZIP in .net core not working
I'm attempting to add Gzip middleware to my ASP.net core app. I have added the following package : > "Microsoft.AspNetCore.ResponseCompression": "1.0.0" In my startup.cs for the Configure Service...
- Modified
- 19 Jan at 01:25
AuthenticationContext.AcquireTokenAsync
I would like to be programmatically able to get a token from Azure. I call `GetAToken().Wait();` and it fails. and the method is:
ISO UTC DateTime format as default json output format in MVC 6 API response
Does anyone know how to configure MVC6's json output to default to a ISO UTC DateTime string format when returning DateTime objects? In WebApi2 I could set the JsonFormatter SerializerSettings and co...
- Modified
- 3 Dec at 14:9
C# - Export .pfx certificate and import it later as a file
I basically need to export a `.pfx` certificate as a `Base64string`, store it in a database and recover it later, converting from `Base64string`. What I'm using at the moment is the `X509Certificate2`...
- Modified
- 7 May at 02:10
python pip on Windows - command 'cl.exe' failed
I'm trying to install spaCy using `pip install spacy` but I'm getting the following error .. [](https://i.stack.imgur.com/z2W1Y.png) I have VS 2015 installed, and I have the following Python install...
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...
- Modified
- 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:...
- Modified
- 13 May at 10:38
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...
- Modified
- 21 Feb at 14:43
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...
- Modified
- 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...
- Modified
- 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 ...
- Modified
- 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...
- Modified
- 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...
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...
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...
- Modified
- 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...
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...
- Modified
- 18 Jan at 09:30
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_...
- Modified
- 18 Jan at 04:7
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\...
- Modified
- 18 Jul at 12:30