ServiceStack server-sent events - parameterized channels?

If I'm building something like a real time stock update page and want to send the updates via SSE - is the best practice to embed any parameters you need for the service (the stock symbol) as part of ...

23 Feb at 20:3

Download file to browser using .NET Core Razor Pages

Using ASP.NET Razor Pages, I am trying download a file to the browser. From the Page(html), using a link like this works fine: ``` href="/DownloadableFiles/testB.csv" download="newname">Download Link...

23 Feb at 17:32

How do I know if automapper has already been initialized?

Is there a way to know if automapper has already been initialized? For example: ``` AutoMapper.Mapper.IsInitialized(); // would return false AutoMapper.Mapper.Initialize( /*options here*/ ); AutoMapp...

1 Jun at 06:45

Unity [UNET] Sync non-player object transform not working

I am trying to sync the transform of one non-player gameobject in Unity by using UNET. Basically I have a player that can go against that object and move it, and I want the transform of that object to...

23 Feb at 15:3

Enum returning string value in WebAPI

I have come across a piece of code in my Web API project, which has a class of this structure: ``` public class QuestionDto { public bool disabled {get;set;} public int id {get;set;} publi...

20 Jun at 10:30

Why does Scoped service resolve as two different instances for same request?

I have a simple service that contains a `List<Foo>`. In Startup.cs, I am using the `services.addScoped<Foo, Foo>()` method. I am inject the service instance in two different places (controller and m...

How to access appsettings from another project

In the startup file I need a way to access IConfiguration in another project. I have been told the Business Logic should not know about IConfiguration. If thats the case then how do I inject data from...

23 Feb at 13:44

How to avoid the "Windows Defender SmartScreen prevented an unrecognized app from starting warning"

My company distributes an installer to customers via our website. Recently when I download via the website and try to run the installer I get the warning message: > Windows protected your PCWindows De...

What's the benefit of var patterns in C#7?

I don't understand the use case of `var` patterns in C#7. [MSDN](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/is#var): > A pattern match with the `var` pattern always s...

11 Apr at 16:11

What is the difference between UTC and GMT?

I have a few queries regarding the Time zones: 1. Can the time be captured in UTC alone? 2. Is UTC -6 and GMT -6 the same, and does that mean it is US local time? 3. Say, I have UTC time as "02-01-20...

30 Oct at 09:12

ASP.Net Core 2.0 SignInAsync returns exception Value cannot be null, provider

I have an ASP.Net Core 2.0 web application I am retrofitting with unit tests (using NUnit). The application works fine, and most of the tests thus far work fine. However, testing the authentication/...

24 Feb at 04:3

How to access IConfigurationRoot in startup on .net core 2?

I have written a custom `ConfigurationProvider` with the entity framework. Since I also want to make it updateable during runtime, I have created a [IWritableableOption](https://stackoverflow.com/a/42...

No bearer token or refresh token being returned in response, CORS suspected - ServiceStack

In my development environment, everything works fine. Going to staging, however, now we have different domains and CORS issues for sure, which I have fully resolved expect for potentially one issue. ...

22 Feb at 22:45

How should I convert a function returning a non-generic Task to ValueTask?

I'm working on some code which builds a buffer in memory and then empties it into a `TextWriter` when the buffer fills up. Most of the time, the character will go straight into the buffer (synchronous...

Access denied file in asp.net core

When i publish my project to `iis` and i do upload a picture on browser so this operation is fails and show this error in `logger sysytem` > An unhandled exception has occurred: Access to the path 'C:...

6 May at 20:41

Difference between .RunSynchronously() and GetAwaiter().GetResult()?

I'm trying to run an asynchronous task synchronously and was wondering what the differences between `.RunSynchronously()` and `GetAwaiter().GetResult()` were. I've seen a lot of comparisons between `...

22 Feb at 16:41

Why use C# async/await for CPU-bound tasks

I'm getting the hang of the async/await keywords in C#, and how they facilitate asynchronous programming - allowing the the thread to be used elsewhere whilst some I/O bound task like a db call is goi...

How to add clear button to TextField Widget

Is there a proper way to add a clear button to the `TextField`? Just like this picture from Material design guidelines: [](https://i.stack.imgur.com/nMAJn.png) What I found is to set a clear `Icon...

8 May at 06:16

Visual Studio: GlobalSuppressions.cs: Prefix ~P: for attribute Target in SuppressMessage

I suppressed several (IntelliSense) messages in Visual Studio 2017. I created entries in file `GlobalSuppressions.cs` like: ``` [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Wrong Usage...

19 Sep at 09:22

How Blazor Framework get notifed when the property value gets changed

When we have a HTML code like below. ``` <h1>@Title</h1> ``` and C# like below ``` public string Title { get; set; } ``` Think I have executed a code like below ``` Title = "New title updated i...

27 Aug at 05:36

Delete cookies in .net core 2.0

I am working on .Net Core 2.0 MVC Web Application. There is a need to manipulate authentication cookie to set expire time span based on user role. After the expire time span, the user will be logged o...

26 Nov at 17:11

Cypress: Test if element does not exist

I want to be able to click on a check box and test that an element is no longer in the DOM in Cypress. Can someone suggest how you do it? ``` // This is the Test when the checkbox is clicked and the e...

16 Dec at 00:12

Adding new authentication schemes dynamically

I'm building an ASP.Net Core 2 PoC for some authentication/authorization discussions/decisions that we need to make. I'm currently at a point where a user has just defined a new OpenID Provider that ...

21 Feb at 15:49

Equivalent of console.log in C#

I am running an MVC Web application built by using Visual Studio 2017. I want to test some parts of C# code `without using debugger breakpoints`. Is there any way to know a certain part of code has ru...

21 Feb at 10:32

How to Reference Microsoft.VisualBasic in a .Net Standard Class Library?

I am attempting to utilize some of the static classes in the `Microsoft.VisualBasic` name space in a .Net Standard 2.0 Class library (the `Financial.Rate` function specifically.) This is a C# project ...

21 Feb at 14:7