Category ".net-5"

Can't add reference to System.Windows.Forms to .NET 5.0 Xunit unit test project

I have a solution in Visual Studio 2019 containing a WinForms .Net Framework 4.8 project and a .Net 5.0 test project. The WinForms project contains all my windo

error in publish blazor-wams version.net5 after install visual studio 2022

I'm having a weird issue with publishing my Blazor WASM version .net5 project to IIS Service after I install my Visual Studio 2022 In Console Write This Error :

Unit Testing - How to build tests around domain entities with lots of encapsulation and many internal states

Admittedly, very new to Unit Testing right now but I'm wanting to make sure I don't end up with a testing project that ends up being a nightmare to maintain. Th

System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String' with .NET 5

I've been implementing IdentityServer4 to provide authorization for my React application. I have this working in my local dev environment, but am running into i

How to achieve strictly file size limit in Abp

I'm trying to set strictly file size limit using filter, in the mean while, there is already a default global setting at Startup.cs Startup.cs int sizeLimit = 2

How to control and secure blazor spa pwa app?

I have pwa blazor .NET 5 app hosted on github. People use this app at work, installed through chrome or firefox or safari on devices. It works offline and updat

How can I reduce the amount of files produced by dotnet publish command line? [closed]

I tried to publish my dotnet app using dotnet publish --output publish --configuration Release but the result not as expected because the last

HttpContext GetEndpoint on modified request path .net 5

I'm trying to create a middleware to handle country code in the url. The code i have works great for removing the country code, so it's routed to the correct en

Logging using Serilog to SQLite sink

I'm not able to make SeriLog work with SQLite sink. My project setup is as follows: Packages I have installed: My SQLite database: My appsettings.json file

Setting the global state only once using Fluxor in Hosted Blazor WASM app

I have a .NET 5.0 Hosted Blazor WASM app that looks like this: I am using scaffolded Identity razor pages in server project for sign in and sign up etc. I want

Getting 404 NotFound for blazor.webassembly.js (_framework files not found)

We have searched other issues along this line, and found that they seem to apply to after a site is deployed. This happens within VS 2019 when trying to debug.

NET 5 and EF: how to use AddPooledDbContextFactory in liu of DbContext in services

I recently came across AddPooledDbContextFactory concept as part of my NET 5 self-education piece and am keen to implement it properly. However, I am not sure h

Ubuntu-OS Compatible Tiff image format to Jpeg image format Convertion (.NET 5)

I want to Convert Tiff file/filestream into Jpeg file/filestream. I am curretly developing a Blazor Server app with .NET 5 in Windows. But my Server is in Ubunt

How to hash string in Blazor wasm?

In Net 5 Blazor client webassembly I can not use System.Security.Cryptography to compute SHA512. What are working alternatives? So that some text hashed has the

Callback or event/delegate from C# core rest api BackgroundService

I´m currently working on a C# core 5.0 REST API with a RabbitMQ messagebus. I´ve created a class that derives from BackgroundService and the consume

Global.Micrsoft.VisualBasic.ApplicationsServices... is not defined error BC30002

I'm converting some old legacy VB apps from .NET framework to .NET 5, and have worked through most of the issues, however, I'm lost on these: Error BC30002 Ty

CentOS - Has AspNetCore.App 5.0.6 but needs AspNetCore.App 5.0.0

I am trying to run a .NET 5 console application (developed on Windows) in a docker container on CentOS 7. I have the following: [root@AU4RLBNAGV04A KLM Releases

Dependency Injection in Startup.cs difficulties

I am trying to inject some Data into the Startup.cs file without success. For example, this injection works fine on my Email Class and I am able to read the _d

Deploying Azure Function (isolated process) to Azure using Azure DevOps is not working

Currently Microsoft has introduced a new way to treat azure functions called isolated process and it's the only way to run Azure functions on .NET5. I am trying

How to pretty print using System.Text.Json for unknown object

Using System.Text.Json i can pretty print json using serialization option. var options = new JsonSerializerOptions{ WriteIndented = true }; jsonString = JsonSer