Category ".net-core"

Oracle SQL statement returns no rows when executed from C# application

Following SQL statement returns data when executed in Oracle SQL Developer: SELECT TC_GUID FROM TBLBUF WHERE TC_DEST = 'aaaaaaa' AND TC_STATE <= 20 but when

IPC using .NET Core that supports duplex channel or callbacks

I am evaluating .NET Core 2.0 for IPC communication. I found that .NET Core does not support WCF on the server side. What can be used in .NET Core for inter-pro

Application Insights duplicated logs

I have a .net core API running under Azure Kubernetes service, with Application Insights provisioned with Terraform. When viewing Application Insights in the Az

error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.3\Microsoft\Portable\v5.0\Microsoft.Portable.CSharp.targets" was not found

I have .net core test project. When I build it in visual studio or use the TestManager it build without a problem. But when I execute the following command on t

Creating a tree from a collection List<T>

In order to create a tree, I use the following code. var db = _context.GetContext(); var accounts = await db .Set<TradingAccount>()

How to write Repository method for .ThenInclude in EF Core 2

I'm trying to write a repository method for Entity Framework Core 2.0 that can handle returning child collections of properties using .ThenInclude, but I'm havi

.Net Core unable to use Bitmap

I am working on a Web Service using .Net Core 2.1. I have a byte array containing all pixels values (in grey scale), a width, a height. I want to create a bitm

ASP.Net Core Web API ModelState unvalidated when Dictionary used in FromQuery

I have a GET endpoint which accepts a few parameters and a Dictionary in the Query. public IActionResult Get([FromQuery] RequiredFields required, [FromQuery] D

How can I build an IOptionsMonitor<T> for testing?

For the normal IOptions interface, you can manually build an instance e.g. this SO question. Is there any equivalent way to make an IOptionsMonitor instance wi

Reload Serilog JSON Configuration on changes in .NET Core 2.1

I'm currently working on a ASP.NET Core 2.1 application and I use Serilog for logging. I want to reload the application settings file for my Serilog implementat

Kestrel error: address already in use (dotnet core)

Summary: it works as dotnet run, but it doesn't work as dotnet myappname.dll. My linux skills are limited, but I am trying to go by the book so I don't mix thi

Can ASP.NET CORE MVC be hosted in Xamarin App(Android)?

I have a ASP.NET CORE MVC (.NET CORE 3.1) application running well on Kestrel in Windows, Now I'm wondering if possible to migrate it to Android via Xamarin? T

Can I determine the .NET SDK version used when building from a .csproj or .targets file?

This is mainly to try to work around an annoying coupling of the .Net analyzers to the version of Visual Studio that the .NET SDK version has an affinity to. If

CompilationFailedException during runtime compilation of Razor from AspNetCore TestHost

I have ASP.Net MVC application, one part of it is compiling razor views to string. The code is very similar to this example: https://long2know.com/2017/08/rend

How to force rebuild with .NET Core on the Mac

In Eclipse we "clean". In Ant we "clean". How do we clean or force a rebuild with DotNet Core command on the Mac? Trying to rebuild with the simple build comman

DotNetCore 1.0 MVC how to automatically redirect to a single domain in live

I have multiple domains for a website: http://example.com http://www.example.com http://www.example.co.uk In production, I want the primary domain to be htt

Best strategy for creating a child container (or isolated scope) with Microsoft.Extensions.DependencyInjection

In my AspNetCore application, I process messages that arrive from a queue. In order to process a message, I need to resolve some services. Some of those service

ZipArchive Read From Unseekable Stream Without Buffering to Memory

Is there a way to read a zip file from a network stream without buffering it entirely in memory? I'd have liked to avoid downloading the entire file before star

Bearer error="invalid_token", error_description="The issuer is invalid"

I have a simple web api project, which looks like this: [Authorize] [Route("Get")] public ActionResult<string> SayHello() {

NLog not logging debug messages

I'm having a problem with logging Debug level messages in a .NET Core 3.1 Worker Service project. Neither my file target or console are getting Debug level mess