Meaning of curly braces after the "is" operator
I found in some C# source code the following line: ``` if(!(context.Compilation.GetTypeByMetadataName("Xunit.FactAttribute") is { } factAttribute)) ``` and here is another one: ``` if(!(diag...
- Modified
- 5 Nov at 14:56
Render razor page with RazorViewToStringRenderer and ServiceStack
I'm trying to render a razor page to send it as an email template. I'm adding the views on a Razor library and trying to render these from a ServiceStack project using this [class](https://github.com/...
- Modified
- 1 Jun at 18:6
A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
All of sudden I start getting this error, and I am not getting idea why if anyone just let me know where this error is, will be enough helpful. As much I am able to get is this because of new update o...
- Modified
- 9 Oct at 11:38
.NET Core - System.Private.CoreLib.dll vs System.Runtime
In a .NET Core App, if I do `typeof(DateTime).Assembly.Location` I get > C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Private.CoreLib.dll But the [documentation](https://lea...
- Modified
- 1 Jun at 10:9
Recompile .razor files on save for Blazor WASM
Is there a way to make Blazor Webassembly recompile `.razor` files when they're changed/updated and then saved? I'm used to this happening both in traditional ASP.NET Core MVC razor views as well as c...
- Modified
- 31 May at 23:2
EF Core queries all columns in SQL when mapping to object in Select
While trying to organize some data access code using EF Core I noticed that the generated queries were worse than before, they now queried columns that were not needed. The basic query is just selecti...
- Modified
- 31 May at 11:41
(422) Unprocessable Entity with ServiceStack Routing
I had a plan to connect to a JSON-based API using ServceStack's Routing features for C#. It seems that I get a '422 Unprocessable Entity' when attempting to do so when, in reality I'm supposed to be g...
- Modified
- 31 May at 01:15
Unexpected non-equality after assignment
Given the following code: ``` using System; class MyClass { public MyClass x; } public static class Program { public static void Main() { var a = new MyClass(); var b = ...
- Modified
- 29 May at 19:16
.Net Core Automapper missing type map configuration or unsupported mapping
Net core application. I am trying to use Auto mapper but results in the below error. > ``` .Net Core Automapper missing type map configuration or unsupported mapping ``` I have below setup in start...
- Modified
- 29 May at 10:31
ServiceStack Redis Mq: is eventual consistency an issue?
I'm looking at turning a monolith application into a microservice-oriented application and in doing so will need a robust messaging system for interprocesses-communication. The idea is for the microse...
- Modified
- 29 May at 01:55
ServiceStack.Text: problems with csv file which contains double quotes
I'm using ServiceStack.Text library (V. 5.8.0) and experiencing problems while using it: Data class (C#): ``` [DataContract] public class Item { [DataMember(Name = "id")] public String PartI...
- Modified
- 28 May at 15:10
C# 8 switch expression for void methods
I'm aware of the `C# 8` `switch expression` syntax for methods that return a value or for property matching. But if we just need to switch on a string value and execute a method that returns nothing (...
- Modified
- 27 May at 11:49
ILogger not writing TRACE and DEBUG messages to target
I'm working on setting up some logging in our ASP.NET Core 3 application, using ILogger (Microsoft.Extensions.Logging) with NLog to enable writing to text files. The problem is, that the ILogger does...
- Modified
- 26 May at 08:3
ServiceStack IContainerAdapter adapting Autofac 5.2.0 version
I'm trying to upgrade the latest package to `5.2.0`, but not really successfully becasue of interface changes, From (`Autofac 4.9.4`) ``` public static class ResolutionExtensions { public stati...
- Modified
- 26 May at 05:1
Service stack server OnReconnect event is not fired when server reconnected successfully
I am working on the serviceStack and react-redux project. I have to create functionality to detect that the user is connected to the network or not. For that, I'm using SSE reconnect event to get the ...
- Modified
- 25 May at 09:25
AWS Log Insights query with string contains
how do I query with contains string in AWS Log insights ``` fields @timestamp, @message filter @message = "user not found" | sort @timestamp desc | limit 20 fields @timestamp, @message filter @messag...
- Modified
- 13 Jul at 17:23
Preload folder icon for a specific folder in Windows Icon cache, in C# or VB.NET
I need to mention a 3rd party program, or better said the source-code of [WinThumbsPreloader](https://github.com/bruhov/WinThumbsPreloader/blob/master/WinThumbsPreloader/WinThumbsPreloader/ThumbnailPr...
URL from BlobItem
I would like to get the URL for a `BlobItem`. In the Azure Portal, I can see the URL in the properties section, but when I get the `BlobItemProperties` object from the `BlobItem`, I cannot find the `...
- Modified
- 23 May at 16:30
How to normalize fancy-looking unicode string in C#?
I receive from a REST API a text with this kind of style, for example - ?- ?- нσω тσ яємσνє тнιѕ ƒσηт ƒяσм α ѕтяιηg? But this is not italic or bold or underlined since the type it's st...
How to implement custom authorization filter for Blazor page
Look over the examples on authorization, I am trying to get a solution for a custom authorization filter/attribute. I simply need to check the user identity during Authorization. https://learn.microso...
- Modified
- 4 Jun at 03:24
Referencing netstandard ServiceStact.redis in net48
We have a net48 project which is referencing a netstandard2.0 lib, which is in turn referencing ServiceStack.Redis. This works fine in all our netcore3.1 app, but is causing referencing issues at run...
- Modified
- 22 May at 15:56
Does Channel<T> support multiple ChannelReaders and ChannelWriters, or only one of each?
The documentation for [Channel.CreateUnbounded][1] says: > Creates an unbounded channel usable by any number of readers and > writers concurrently. However [Channel][2] has properties for a single `Ch...
- Modified
- 6 May at 18:42
Switch expression on System.Type in C# 8
I'm curious is any other way to write something like this with new switch expression in C# 8? Because `_ when type == typeof(string)` looks kinda weird especially when we have [type pattern][1] and ot...
- Modified
- 23 Aug at 04:16
Visual Studio 2017 keep file open by default
I have an annoying problem with Visual Studio 2017. Whenever, I open a file using Ctrl+Click navigation, the the file gets opened in purple tab preview mode (for a lack of better term). Please note...
- Modified
- 21 May at 20:30
SignalR and Redis
I've got a project that uses SignalR and a RedisBackplane, we've moved from StackExchange.Redis to ServiceStack.Redis due to Redis Sentinel compatibility issues (Not movable) However, it now looks li...
- Modified
- 21 May at 11:25