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...
ApiMember in java client does not include Format
When I use the Eclipse plugin to generate a client it includes ApiMember as seen below. Problem is that the ApiMember in 'net.servicestack: client' does not include 'Format'. Is there an option I ha...
- Modified
- 1 Oct at 01:56
`X-Forwarded-For` is not used by ASP.Net Core behind reverse proxy
I am trying to of a request (i.e., the IP of the client who sent the request) in my MVC Controller (runs in .Net Docker container). Taking into consideration that My ASP.Net Core application (runs ...
- Modified
- 3 Nov at 21:29
Create default HttpClientFactory for integration test
I have a typed client which I want to register as a singleton: ``` public class SomeHttpClient { private readonly IHttpClientFactory _clientFactory; public SomeHttpClient(IHttpClientFactory ...
- Modified
- 17 Jan at 01:52
Set UserAuth delete cascade without adding dependency to ServiceModel
There are some entities that I want to ensure are deleted if a user is deleted so I have set their models like so to be used with OrmLite: ``` public class UserProcess { [AutoIncrement] publi...
- Modified
- 29 Sep at 14:42
No service for type 'Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]' has been registered
What is the possible cause of this error: > InvalidOperationException: No service for type 'Microsoft.AspNetCore.Identity.UserManager [Microsoft.AspNetCore.Identity.IdentityUser]' has been registered...
- Modified
- 29 Sep at 13:4
Visual Studio Installer Project - shortcut icons not set
I've created a WinForm application with .NET 4.6.1 and C#. I'm using Visual Studio 2017, with latest fixes updated (up to 29-Sept-2018). The application uses a custom icon, and it's correctly shown: e...
- Modified
- 29 Sep at 17:17
Screenshot secure desktop
I am working with screen sharing project.I am capturing desktop screen using below function.it works fine. But whenever [secure desktop prompting for elevation](https://learn.microsoft.com/en-us/windo...
- Modified
- 4 Oct at 12:0