Using ActivatorUtilities.CreateInstance To Create Instance From Type
I am trying to rewrite some code in .Net Core using the built in .Net Dependency Injection. Previously, I was using the current code to create the instance (It was using Unity for DI) which worked gre...
- Modified
- 4 Oct at 11:27
Wrong return value in FromObjectDictionary method
I noticed in ServiceStack.Text\PlatformExtensions.cs file that FromObjectDictionary method could return a wrong value. ``` public static object FromObjectDictionary(this IReadOnlyDictionary<string, o...
- Modified
- 4 Oct at 09:9
Multiple ng-content
I am trying to build a custom component using multiple `ng-content` in Angular 6, but this is not working and I have no idea why. This is my component code: ``` <div class="header-css-class"> <ng-...
- Modified
- 6 Oct at 11:57
Why are we receiving TypeIntializer Exception in ServiceStack after upgrading to Core 2.1 and Framework 4.7.2?
We have a Visual Studio C# solution with several projects including .NET Standard class libraries, .NET Framework applications (because they use 3rd party references that are written on Framework), an...
- Modified
- 3 Oct at 22:34
Batching on duration or threshold using TPL Dataflow
I have implemented a producer..consumer pattern using TPL Dataflow. The use case is that code reads messages from the Kafka bus. For efficiency, we need to process messages in batches when going to th...
- Modified
- 13 Sep at 06:13
NamedPipeServerStream.ReadAsync() does not exit when CancellationToken requests cancellation
When the NamedPipeServer stream reads any data from the pipe it does not react to `CancellationTokenSource.Cancel()` Why is that? How can I limit the time I'm waiting in the server for data from the...
- Modified
- 23 Jan at 20:43
How to add multiple policies in action using Authorize attribute using identity 2.0?
I am identity 2.1.2 with asp.net core 2.0, I have application claim table which have claim type and claim value i.e Assets ,Assets Edit,Assets, Assets View, where claim types are same with distinct c...
- Modified
- 26 Aug at 20:43
Can I use HttpClientFactory in a .NET.core app which is not ASP.NET Core?
I have read the popular blog post [https://www.stevejgordon.co.uk/introduction-to-httpclientfactory-aspnetcore](https://www.stevejgordon.co.uk/introduction-to-httpclientfactory-aspnetcore) on using Ht...
- Modified
- 29 Jan at 19:25
JSON.net deserialize object nested data
I'm working with SwiftType Elastic Search + C# and running into an issue deserializing the response due to the fact that SwiftType returns all of the fields as objects with a `raw` property ([https://...
- Modified
- 31 Oct at 16:57
How to initialize an object in TypeScript
I have a simple model class ``` export interface Category { name: string; description: string; } ``` I need to declare and initialize a variable in an angular component. Tried: ``` category:...
- Modified
- 2 Oct at 20:48
Different NuGet package based on operating system
I have a test project in dotnet 2.1 that needs to work across multiple platforms (specifically, windows and linux-based systems) as well as access DB2 databases. IBM provides separate NuGet packages ...
Why is ASP.NET Core executing a custom middleware only once?
I have an ASP.NET Core with the following controller that accepts a POST request: ``` [Route("api/v1/tenants/tests")] public class TestsController : Controller { [HttpPost] public IAct...
- Modified
- 15 Jul at 11:35
Why does a for loop behave differently when migrating VB.NET code to C#?
I'm in the process of migrating a project from Visual Basic to C# and I've had to change how a `for` loop being used is declared. In VB.NET the `for` loop is declared below: ``` Dim stringValue As S...
Select command in Servicestack.Ormlite is difference in 4.0.54 and 4.0.56 when I profiling
When I profiling the same select command: 4.0.50: ``` SELECT "CustomerID", "CustomerCode", "CustomerName" FROM "dbo"."Customer" WHERE "CustomerCode" In ('871110000','864483025') ``` 4.0.56: ``` e...
- Modified
- 4 Oct at 04:47
WPF designer issues : XDG0008 The name "NumericTextBoxConvertor" does not exist in the namespace "clr-namespace:PulserTester.Convertors"
I have an error that not let me see my designer.. but I have no error on a build and my program runs fine with no problem I have tried to: - - - - Nothing helped. I have no idea what more I can to ...
Change the JSON serialization settings of a single ASP.NET Core controller
I'm having two controller controllers: `ControllerA` and `ControllerB`. The base class of each controller is `Controller`. The `ControllerA` needs to return JSON in the default format (camelCase). Th...
- Modified
- 18 Apr at 00:29
Get claims and subscription in Web Api Controller (.Net Core 2.1)
I'm using JWT with .Net Core 2.1, and the ``` [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] ``` decorator on my controller class. In 2.0 it seemed you had to do some...
- Modified
- 2 Oct at 09:29
C# under Linux, Process.Start() exception of "No such file or directory"
I am having trouble calling a program with the Process class to start a program. The hierarchy to the executable is in under the bin directory while the current working directory needs to be under the...
return tuple result in async method .net core
I have an async method. This method get list of 10 row from database and getting total count of query result. Because I'm using for grid pagination. So, I'm using tuple which one element is List and o...
- Modified
- 1 Oct at 20:9
Azure File Storage: Create nested directories
My code looks like this ``` CloudFileClient client = ...; client.GetShareReference("fileStorageShare") .GetRootDirectoryReference() .GetDirectoryReference("one/two/three") .Create(); ```...
- Modified
- 31 Dec at 08:0
.NET JIT compiler volatile optimizations
[https://msdn.microsoft.com/en-us/magazine/jj883956.aspx](https://msdn.microsoft.com/en-us/magazine/jj883956.aspx) > Consider the polling loop pattern:``` private bool _flag = true; public void Run(...
- Modified
- 1 Oct at 13:29
How to configure CsvHelper to skip MissingFieldFound rows
``` public interface ICsvProductReaderConfigurationFactory { Configuration Build(); } public class CsvProductReaderConfigurationFactory : ICsvProductReaderConfigurationFactory { private reado...
Why does Prettier not format code in VS Code?
In my Nuxt application where ESlint and Prettier are installed and enabled, I switched to Visual Studio Code. When I open a file and press + + and choose , my file does not get [formatted](https:/...
- Modified
- 9 Apr at 08:4
Convert Unicode surrogate pair to literal string
I am trying to read a high Unicode character from one string into another. For brevity, I will simplify my code as shown below: ``` public static void UnicodeTest() { var highUnicodeChar = ""; //...
- Modified
- 1 Oct at 03:42
Post request in Laravel - Error - 419 Sorry, your session/ 419 your page has expired
I installed Laravel 5.7 Added a form to the file `\resources\views\welcome.blade.php` ``` <form method="POST" action="/foo" > @csrf <input type="text" name="name"/><br/> <input type="sub...