Windows 10 Pro -version 1803 bluetooth Profiles Access
We are looking to access and use Bluetooth profiles in our WPF application using C# in Visual Studio 2017. Issue details: Platform: Windows 10 Pro - version 1803. Issue brief: We are trying to acce...
- Modified
- 18 May at 13:16
servicestack plugin to a Windows Service that will serve static files?
I've ServiceStack (V5.1.0) as a Windows Service, serving REST APIs, no problems. I would like to create a plugin that will serve static files from a specific physical directory, for any routes that st...
- Modified
- 18 May at 03:8
How to execute SqlQuery with Entity Framework Core 2.1?
In Entity Framework 6, I can execute a raw SQL query on the database using the following command: ``` IEnumerable<string> Contact.Database.SqlQuery<string>("SELECT a.title FROM a JOIN b ON b.Id = a.a...
- Modified
- 9 Dec at 18:22
Suppress a warning for all projects in Visual Studio
I've seen answers showing how to suppress a warning for a specific line of code or for a specific project. I don't want that. I want to suppress a specific warning for of my projects. (If it matter...
- Modified
- 20 Oct at 18:11
Setting UIaccess altering behavior of ShowDialog
I have a login prompt as part of a WPF application - when the user enters an incorrect password, a new modal dialog window appears informing them that their password is incorrect. This modal dialog is...
Performance Metrics/Diagnostics of .NET Tasks
Is there a way to get data out from .NET about the number of (C# 5 or newer, so post-async/await) Tasks pending execution, and similar metrics, for use in diagnosing issues happening to production ser...
- Modified
- 17 May at 18:28
Injecting Simple Injector components into IHostedService with ASP.NET Core 2.0
In ASP.NET Core 2.0, there is a way to add background tasks by implementing the `IHostedService` interface (see [https://learn.microsoft.com/en-us/aspnet/core/fundamentals/hosted-services?view=aspnetc...
- Modified
- 17 Jun at 12:21
How to optimize WCF CreateFactory in System.ServiceModel.ChannelFactory?
My current implementation is utilizing the ClientBase class to create a channel for WCF calls made to a third party API. This third party API requires a X509Certificate2 certificate as well as ClientC...
- Modified
- 17 May at 14:52
Autofac - SingleInstance HttpClient
Have read in various places that HttpClient should be reused rather than a new instance every time. [https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/](https://aspnetmonsters.com/2016/08...
Hyperlinks without underline in RichTextBox on Windows 10 1803
I'm displaying RTF document in `RichTextBox` ("upgraded" to `RichEdit50W`). Keywords in the document are linked to a webpage using a syntax: ``` {\field{\*\fldinst{HYPERLINK ""https://www.example.com...
- Modified
- 17 May at 13:17
Why does an implicit conversion operator from <T> to <U> accept <T?>?
This is a weird behaviour that I cannot make sense of. In my example I have a class `Sample<T>` and an implicit conversion operator from `T` to `Sample<T>`. ``` private class Sample<T> { public r...
- Modified
- 17 May at 12:35
ServiceStack Razor not finding right view
I have a [ServiceStack](http://www.servicestack.net) site that uses [ServiceStack.Razor](http://razor.servicestack.net) without issue. I upgraded from 4.0.50 to 5.1.0 - with no other substantive chan...
- Modified
- 16 May at 20:5
1-length string comparison gives different result than character comparison... why?
I am quite new in C# and I found something unexpected in string comparison which I don't really understand. Can someone please explain me why the comparison between characters gave the opposite resu...
- Modified
- 16 May at 16:54
How to create a table corresponding to enum in EF Core Code First?
How would one turn the enums used in an EF Core database context into lookup tables and add the relevant foreign keys? --- - [EF5 Code First Enums and Lookup Tables](https://stackoverflow.com/q/1...
- Modified
- 16 May at 15:59
Check if value is 0 with extension method
I have an extension method which looks like ``` public static T ThrowIfObjectIsNull<T>(this T argument) where T : class { if (argument == null) throw new ArgumentNullException(nameof(argumen...
- Modified
- 16 May at 20:41
'4' and '4' clash in primary key but not in filesystem
There is DataTable with primary key to store information about files. There happen to be 2 files which differ in names with symbols '4' and '4' (0xff14, a "Fullwidth Digit Four" symbol). The DataTable...
- Modified
- 16 May at 13:11
ReadAsMultipartAsync equvialent in .NET core 2
I'am rewriting a .net 4.5 application to aspnet core 2.0 and I have a method that i have some problem updating: ``` [HttpPut] [Route("api/files/{id}")] public async Task<Person> Put(int id) ...
- Modified
- 16 May at 10:48
Xamarin.Forms Animation on click Button (Flash background)
I want to implement a dialpad on my form. Now, in my XAML I am testing a button: XAML ``` <?xml version="1.0" encoding="UTF-8"?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" x...
- Modified
- 20 May at 20:6
Error combining 'if' statements that null-checks and Pattern Matches
The following works as expected: ``` dynamic foo = GetFoo(); if (foo != null) { if (foo is Foo i) { Console.WriteLine(i.Bar); } } ``` but if I combine the if statements like so...
- Modified
- 11 Apr at 16:12
How to handle enum as string binding failure when enum value does not parse
In our ASP.net Core Web API application I am looking for a way to catch binding errors when my controller method accepts a complex object which has an ENUM property when ENUMs are de/serialized as str...
- Modified
- 6 May at 20:40
.NET Core 2.0 Regex Timeout deadlocking
I have a .NET Core 2.0 application where I iterate over many files (600,000) of varying sizes (220GB total). I enumerate them using ``` new DirectoryInfo(TargetPath) .EnumerateFiles("*.*", Searc...
- Modified
- 16 May at 18:37
C# 7.3 Enum constraint: Why can't I use the nullable enum?
Now that we have enum constraint, why doesn't compiler allow me to write this code? ``` public static TResult? ToEnum<TResult>(this String value, TResult? defaultValue) where TResult : Enum { ...
Automate CRUD creation in a layered architecture under .NET Core
I'm working in a new project under a typical three layer architecture: `business`, `data` and `client` using Angular as a front. In this project we will have a repetitive task that we want to automat...
Migrate existing Microsoft.AspNet.Identity DB (EF 6) to Microsoft.AspNetCore.Identity (EF Core)
I am working on an application (APS.net MVC) which uses . Now I want to revamp my application to APS.net Core which uses . But those two has some differences in each model. Is there any direct way to ...
- Modified
- 16 May at 11:54
What does the .dtbcache file do?
I have a C# WinForms project, which I am working on in Visual Studio 2017 (although it was originally created in the 2015 version). I don't recall having done anything special, but it has added a fi...
- Modified
- 15 May at 06:17