Is ReuseScope.Request supported on .NET Core 3.1?
We are getting an error on a ServiceStack application (v5.8 running in IIS) were it seems that requests are getting mixed up when executed concurrently. I've managed to reproduce fairly reliably with ...
- Modified
- 9 Feb at 13:28
ServiceStack ORMLite paging on SQL Server 2008
I have an existing SQL Server 2008 database which has a number of views, stored procedures and functions. I want to be able to `SELECT` data from one of these SQL functions and limit the number of row...
- Modified
- 9 Feb at 10:0
Seeding data in many-to-many relation if EF Core
I have User entity I have Technology entity I want to create many-to-many relation, so I have such `OnModelCreating` method: When I want to create migration I receive such an exception - > The seed en...
- Modified
- 6 May at 07:15
ServiceStack OnDeserialized Equivalent
I am deserialize a websocket message in real time. In the message (string of json) I receive there is a unix timestamp (long). As soon as each object is deserialized I need it to call a method ASAP ...
- Modified
- 5 Feb at 04:59
How can I implement an additional layer of expiring-token-based authorisation in ServiceStack?
We have a mobile app with ServiceStack-based cookie authentication. The app stores the user's login cookie and keeps itself logged in if the user so desires. We have a 'Purchase PIN' feature in the ap...
- Modified
- 5 Feb at 17:43
ServiceStack Deserialize int (unix timestamp in ms) to DateTime
Here is a snippet of my current class: As you can see I'm deserializing to a `long` and then once it's done it calls the OnDeserialized method to finish up. Does ServiceStack have a better way to do ...
- Modified
- 8 Feb at 16:49
How to Deserialize json to one of several DataContracts with ServiceStack
I'm connected to a websocket and subscribed to the MessageRecieved event. In that event I will get a string (json) that could be deserialized to any of about 5 different DataContracts. Right now I'm...
- Modified
- 4 Feb at 15:22
Different results between c++ and c# sin function with large values
I came across such strange behavior of the Math.Sin function in C#, when I use large numbers; for example: C#: .Net 4.7.2: Math.Sin(6.2831853071795856E+45) = 6.2831853071795856E+45 C++: sin(6.28318530...
- Modified
- 28 Feb at 00:52
.NET 5 Blazor Server ServiceStack template
I'm looking to build a .NET 5.0 Blazor Server app from scratch. Rather than using the standard `blazorserver` template out of the box I would like to base the app on a ServiceStack API backend. I see...
- Modified
- 2 Feb at 19:51
How to prevent EF core from creating a save point when saving
We're using EF Core within a context where we always manage the transaction externally. We also have to use MARS. This combination causes the following warning since we've upgraded to EF Core 5: I'm f...
- Modified
- 5 May at 18:37
Emgu error when trying to install emgu.CV.runtime.windows in VC# 2017
I'm trying to install emgu.CV.runtime.windows from within Visual Studio 2017, and installing by the recommeded method of right-clicking references and installing via NuGet. However I am getting the er...
Use .NET Core Identity with an API
i've created an API and set up JWT auth from the same API (I chose not to use IdentityServer4). I did this through `services.AddAuthentication` And then I created tokens in the controller and it works...
- Modified
- 6 May at 07:16
C# records constructor parameter default value empty IEnumerable
I am converting this class ``` public class MyClass { public IEnumerable<string> Strings { get; } public MyClass(IEnumerable<string>? strings = null) { Strings = strings ?? new Li...
- Modified
- 31 Jan at 12:48
"Cannot read property '_blazorFilesById' of null error" with Blazor InputFile component
I've started getting this error from my Blazor WebAssembly app: > "Cannot read property '_blazorFilesById' of null error" with Blazor app I'm assuming that's related to the `InputFile` [component](htt...
- Modified
- 30 Jan at 22:40
"using static" kills AsParallel
In the following code, if you uncomment the "using static" line, the query will not run in parallel. Why? (Visual Studio Community 2019, .Net Core 3.1 / .Net 4.8) ``` using System; using System.Diagno...
Servicestack execution timeout on .net core
We use Service stack, and run using the InProcess model on .net core. We have some longer running requests, which we would like to timeout - however, I am struggling to do this. Before .net core, you...
- Modified
- 29 Jan at 11:39
Is it possible to remove the full-paths from .NET assemblies created with dotnet build?
I build my project with `dotnet build`, targeting `netcoreapp3.1`. The problem is that the assemblies contain the full path to the source-files: This means that the hash of the assemblies depends on t...
System.BadImageFormatException on running ServiceStack AutoQuery
The Project is running on asp.netcore 3.1.0. I encountered the exception System.BadImageFormatException at ServiceStack.ServiceStackHost. I just can't get AutoQuery working. the stack trace is below ...
- Modified
- 27 Jan at 11:37
Changing name of automatic attached file in e-mail
I am using Mailkit library to send e-mails. This is the code to do so: ``` public async Task SendAsync(IdentityMessage message) { if (message == null) return; LinkedRe...
- Modified
- 27 Jan at 22:1
Why am I not allowed to return an IAsyncEnumerable in a method returning an IAsyncEnumerable
I have the following interface: ``` public interface IValidationSystem<T> { IAsyncEnumerable<ValidationResult> ValidateAsync(T obj); } ``` And I am trying to implement it this way: ``` public cla...
- Modified
- 27 Jan at 10:57
Compiling existing C# code to WebAssembly
Is it possible to compile existing C# code to WebAssembly (.wasm) so that no or nearly no code changes have to be done? Do I have to use Blazor for it or are their other possibilities?
- Modified
- 16 Jul at 21:3
Upgrading pip fails with syntax error caused by sys.stderr.write(f"ERROR: {exc}")
On a fresh Vagrant VM using box bento/centos-7 the following commands corrupt my pip installation: ``` yum update yum install epel-release -y yum install python-pip -y /usr/bin/pip2 install --upgrade ...
Message template should be compile time constant
I have this code ``` [HttpGet("average/{videoGuid}")] public async Task<IActionResult> AverageRatingOfVideo([FromRoute] string videoGuid) { _logger.LogInformation($"Finding average rating of video...
SetBasePath not present in ConfigurationBuilder under .NET Core 5
According to the docs for .NET Core 5, there's a method [SetBasePath](https://learn.microsoft.com/en-gb/dotnet/api/microsoft.extensions.configuration.fileconfigurationextensions.setbasepath?view=dotne...
- Modified
- 24 Jan at 16:26
Bind IConfiguration to C# Record Type
I would like to bind configuration to record type. This is definition of configuration type (it is without parameterless constructor): ``` public record AppConfiguration(string ConnectionString); ``` ...
- Modified
- 23 Jan at 13:4