How to handle currentDomain.UnhandledException in MSTest
I tried to implement solution based on answer [How to handle exceptions raised in other threads when unit testing?](https://stackoverflow.com/a/934604/518530), but I still don't understand what to do ...
- Modified
- 23 May at 11:53
Akka.NET cluster node graceful shutdown
## Background I have a Akka.NET cluster containing a Lighthouse seed node and two other nodes running actor systems. When I attempt to do a graceful shutdown on one of my cluster nodes I want to se...
- Modified
- 27 May at 09:26
What does IAppbuilder.UseWebApi do?
I've recently been working on an MVC site that has an api and in the startup.cs there is a line that says `app.UseWebApi`. I did some searching but I couldn't find a decent answer of what it does. Can...
- Modified
- 11 Jul at 14:0
How to get normal/custom error response for an exception from an Action returning Stream in ServiceStack?
I have been venturing in the ServiceStack's [documentation](https://github.com/ServiceStack/ServiceStack/wiki/Error-Handling) regarding an issue with throwing from an Action that returns a . The iss...
- Modified
- 12 Jul at 06:45
How to implement nhibernate session per request pattern, using Service stack's funq container as a dependency injector
I am getting the session by injecting session to service method in global.asax as 1 ``` protected void Application_Start() { this.RegisterContainer(); } ``` 2 ``` private void RegisterCont...
- Modified
- 11 Jul at 13:31
How to use the new IValueResolver of AutoMapper?
I am at a loss as to how to use the new `IValueResolver` interface in the new version of AutoMapper. Perhaps I used them improperly in the previous versions of AutoMapper... I have a lot of model cla...
- Modified
- 15 Aug at 10:54
What happens when awaiting on already-completed task?
When I construct an instance of a class that I have, I would like to trigger a Token renewal function (`async` method) and let it run in the background (I keep a reference to the returned `Task`). La...
- Modified
- 11 Jul at 12:1
Model binding in ASP.NET Core to map underscores to title case property names
I have a model class that I want to bind a query string to in my ASP.NET MVC Core (RC2) application. I need to support underscores in query string keys to confirm to OAuth specs, but I want to work w...
- Modified
- 11 Jul at 12:35
How can versioning be done in ASP.NET Core Web Api
In previous `asp.net web api`, I implement `DefaultHttpControllerSelector` to specify how I want the request to locate my controller. I often have different controllers with different names but intend...
- Modified
- 12 Jul at 07:44
How to select last record in a LINQ GroupBy clause
I have the following simple table with , and . [](https://i.stack.imgur.com/4WFKQ.png) I want to select records and `GroupBy contactId`. I used this `LINQ` extension method statement: ``` Mains.Gr...
Nested FOR loops: readability & performance
I understand nested FOR loops. I understand what they do, and how they do it. But my problem is that they seem horribly unreadable to me. Take this example: ``` for (int i = 0, y = 0; y <= ySize; y+...
- Modified
- 11 Jul at 12:21
ScrollIntoView and ListView with virtualization
I have `ListView` (virtualization is on by default), which `ItemsSource` is bound to `ObservableCollection<Item>` property. When data are populated (property is set and notification is rised) I see 2...
- Modified
- 23 May at 12:33
What are buildOptions and preserveCompilationContext used for?
I am playing with just released ASP.NET Core. I have created new project and I am looking at `project.json`. I'd like to know what is this part of configuration for: ``` "buildOptions": { "emitEnt...
- Modified
- 11 Jul at 16:55
Getting Unexpected Token Export
I am trying to run some ES6 code in my project but I am getting an unexpected token export error. ``` export class MyClass { constructor() { console.log("es6"); } } ```
- Modified
- 11 Jul at 07:32
Application_Error() not firing
I'm trying to run an ASP.NET application that logs exceptions to the database. I'm using Application_Error to catch the exception. Before adding the connection string, just to test my code (Logger cl...
ServiceStack.Text RegisterLicense throws exception
I just recently upgraded to ServiceStack.Text 4.x, the paid license. One of my apps is a console app and it uses the following code to register the license: ``` public static class License { publ...
- Modified
- 10 Jul at 18:40
How to return value from function which has Observable subscription inside?
I dont know how to extract value from Observable to be returned by function in which Observable is present. I need just a value from it to be returned, nothing else. Current version which works ``` ...
- Modified
- 13 Nov at 22:49
Can not open ServiceStack mvc project
I can not open ServiceStack Mvc project on visual studio 2012. This error message appears: [](https://i.stack.imgur.com/qC6Os.png) I've installed "Microsoft Visual Studio 2012 Shell (Isolated) Redi...
- Modified
- 10 Jul at 14:40
Killing gracefully a .NET Core daemon running on Linux
I created a .NET Core console application running as a daemon on a Ubuntu 14.04 machine. I want to stop the service without forcing it, being able to handle a kill event. How can I achieve this?
OWIN Configuration: What's the difference between CookieAuthenticationDefaults.AuthenticationType and DefaultAuthenticationTypes.ApplicationCookie
I'm revisiting some code in my OwinStartup class and have this definition: ``` app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.Applic...
- Modified
- 10 Jul at 00:31
Calculate Code Metrics for .NET Core Projects?
I am playing arround with ASP.NET Core and .NET Core projects. For classic C# projects Visual Studio 2015 has got the feature to calculate code metrics. For .NET Core the support is missing in the Pre...
- Modified
- 16 May at 20:15
ASP.NET Core Browser Link `Unable to get property 'files'`
In the Microsoft Virtual Academy course ['Introduction to ASP.NET Core (formerly ASP.NET 5)'](https://mva.microsoft.com/en-US/training-courses/introduction-to-asp-net-core-formerly-asp-net-5--13786?l=...
- Modified
- 9 Jul at 21:45
Python's equivalent to null-conditional operator introduced in C# 6
Is there an equivalent in Python to C# [null-conditional operator](https://msdn.microsoft.com/en-us/library/dn986595.aspx)? ``` System.Text.StringBuilder sb = null; string s = sb?.ToString(); // No e...
TimeSpan to Custom string like HH:mm:ss
I would like to convert ``` var delta = TimeSpan.FromSeconds(10); ``` to string like `00:00:01` I try this `delta.ToString(@"0:\\hh\\:mm\\:ss", System.Globalization.CultureInfo.InvariantCulture);...
- Modified
- 9 Jul at 19:55
Rendering an array.map() in React
I am having a problem where I am trying to use array of data to render a `<ul>` element. In the code below the console logs are working fine, but the list items aren't appearing. ``` var Main = React....
- Modified
- 28 Dec at 16:33