Migrating to .NET 6.0 error on publish: Assets file doesn't have a target for 'net5.0'
I'm trying to migrate from .NET 5 to .NET 6. I've installed VS 2022 Community Preview and the Hosting Bundle... and updated everything in NuGet. The project will build without errors but when I go to ...
- Modified
- 9 Oct at 13:55
EditorConfig control File-scoped namespace declaration
I'm using C# 10 new feature `File-scoped namespace declaration`. I have old code like this ``` namespace SampleCode { public class MyClass { } } ``` I'm moving this code to ``` namespace ...
- Modified
- 7 Oct at 18:47
ASP.NET 6 + Identity + Sqlite, services.AddDbContext() how?
I am using a tutorial for ASP.NET Core 5.0 + SQL Server, but I am actually using ASP.NET Core 6.0 + Sqlite. The tutorial has the following code in `StartUp.cs` ``` public void ConfigureServices(IServi...
- Modified
- 6 Oct at 20:25
How can I find the Windows product name in Windows 11?
Windows 11, released yesterday, reports itself as Windows 10.0 just about everywhere - `RtlGetVersion` says 10.0, and if you ask `VerifyVersionInfo` if you are 11.0 or greater, it says no. There seems...
- Modified
- 6 Oct at 06:6
.NET 6 XmlSerializer Pretty print
I've this sample .NET 6 program printing out a serialised object to XML: ``` using System.Text; using System.Xml.Serialization; var serializer = new XmlSerializer(typeof(Order)); var order = new Ord...
What does a question mark after a reference type mean in C#?
What is the purpose of the question mark after the type of the parameter which is a reference type? e.g one of the constructors for an `OverflowException` contains `string?` and `Exception?` parameter...
- Modified
- 15 Jul at 19:48
HttpClient - Request was canceled - Timeout of 100 seconds elapsing
I am using a blazor web assembly project followed by a asp.net core web api and a shared project. When running my two projects and pulling up post man to perform a GET request `https://localhost:5011/...
- Modified
- 1 Sep at 11:7
Request timeout when soap12 is malformated
We use Servicestack 5.9.2 and get the following error in the log file when sending an malformated soap message. The soap request runs in a timeout. What do we have to do, that the request gets a respo...
- Modified
- 1 Oct at 09:53
Webpack build failing with ERR_OSSL_EVP_UNSUPPORTED
I'm having an issue with a Webpack build process that suddenly broke, resulting in the following error... ``` <s> [webpack.Progress] 10% building 0/1 entries 0/0 dependencies 0/0 modules node:internal...
- Modified
- 18 Aug at 02:28
How to use appsettings.json in Asp.net core 6 Program.cs file
I'm trying to access appsettings.json in my Asp.net core v6 application Program.cs file, but in this version of .Net the Startup class and Program class are merged together and the using and another s...
- Modified
- 16 May at 15:15
HttpPost Data in JSV formst
I need to communicate with a service stack web service. It appears to accept form content with jsv values. Is there a way to serialize an object In such a way that this happens automatically? Somethi...
- Modified
- 29 Sep at 23:40
SS OrmLite: Ambiguous column name when joining and filtering on the column name
I have two tables (code first) which shares a common column name "Status", which incidentally is used in a Where clause. This results in the error. ``` var q = db.From<Process>() .Where<Process>(p =>...
- Modified
- 28 Sep at 12:35
Register ServiceStack.OrmLite in .Net Framework 4.7.2
I have a pretty simple library that implements the .Net Standard 2.0 as I need this library across a mix of frameworks (i.e, .Net Framework 4.7.2 applications). At the most basic level the .Net Standa...
- Modified
- 27 Sep at 11:15
Use SELECT DISTINCT ON with OrmLite
I tried writing this code to use `SELECT DISTINCT ON`: ``` var q = Db.From<WatchedUrlScanResult>(); q.Join<WatchedUrlRecord>() .Where<WatchedUrlRecord>(x => x.TargetDomainR...
- Modified
- 26 Sep at 01:8
Need understanding as to why string.StartsWith() is true when it should be false
So I have this file that I download via ftp. The file is just a config file for a system at my company I work for. Once the file is downloaded I open the file and processor the file. Part of the proce...
Is it possible to change HTML title with SwashBuckle and Swagger UI
We have many services, which use SwashBuckle / Swagger UI to expose REST methods. It can often be annoying when you have several of them open in tabs in a browser that you cannot immdiately see the se...
- Modified
- 5 May at 14:55
ServiceStack Authentication flow
I’m integrating ServiceStack authentication in my own web app. The flow that I’m trying to implementing is 1. Calling Authenticate method of my own AuthProvider 2. If the authentication against authR...
- Modified
- 22 Sep at 17:37
Is it possible to create a C# record with a private constructor?
I´m trying to rebuild a `discriminated union type` in C#. I always created them with classes like this: ``` public abstract class Result { private Result() { } public sealed class Ok : Resul...
- Modified
- 23 Jun at 11:33
Using dotnet dev-certs with aspnet docker image
You can use `dotnet dev-certs https` to generate a self-signed certificate for use with ASP.NET as this dockerfile demontrates ``` FROM mcr.microsoft.com/dotnet/sdk:5.0 as build WORKDIR /src RUN dotne...
- Modified
- 22 Sep at 10:28
Why is HttpRepl unable to find an OpenAPI description? The command "ls" does not show available endpoints
I am working through the Microsoft Learn tutorials to "[Create a web API with ASP.Net Core](https://learn.microsoft.com/en-us/learn/modules/build-web-api-aspnet-core/3-exercise-create-web-api)". Under...
- Modified
- 25 Sep at 02:51
What is the difference between "is not null" and "!= null"?
With the release of C# 9.0, the pattern was introduced. The documentation for [pattern matching](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/patterns) states: > Begin...
Autoquery servicestack ILeftJoin issue with table.id column
I have definition of autoquery dto defined as below: ``` [Route("/project/{ProjectId}/contracts/{ContractId}/items")] public class QueryContractItem : QueryDb<ContractItem, ContractItemResponse>, ...
- Modified
- 23 Sep at 08:11
Can OrmLite specify foreign key to an attribute other than the primary key
I have a table structure where a foreign key from Employee table references something other than the primary key of the Department table. This is for historical reasons, so that's just the way it is. ...
- Modified
- 20 Sep at 14:41
Entity Framework | Sequence contains more than one matching element
I used the database first approach. The model is right (or at least it looks like) But I always get this error. Please, I've already tried so many things.. The full code of my program (and even sql sc...
- Modified
- 18 Sep at 16:7
Get X509 Certificate WITH PRIVATE KEY from Azure Keyvault c#
I am currently working on an authentication server developed in C #, this one is hosted on an azure function app, and I use a KeyVault where my secrets are stored. My problem is the following, in my k...
- Modified
- 5 May at 16:48