Collect all kinds of .net programming exceptions and fault solutions.

Build time taking more time and memory (.NET Core Host and Visual Studio Code) using .NET Core 3.1

I am using .NET Core 3.1.2 in the Visual Studio Code editor.
After I execute dotnet publish or dotnet build.
It is taking more time to build the application.
Sometimes the build completed within one

Install Dotnet Core SDK 3.1 in Buildroot?

I have searched for a long time but have not found any instructions or help in the whole WorldWideWeb how to install the DotNet Core SDK 3.1 on a buildroot for 64Bit systems.
Unfortunately DotNet ...

need to integrate azure keyvault with azure webapp code connection string

i have one website which i have posted on azure webapp and that website is connected with SQL database so we are try to setup that database connection string password directly attach with azure key...

Lines are not drawn with PDFSharp on specific machines

I have weird problem. A generate a pdf file from a .net desktop app with PDFSharp 1.50.5147 and on some specific machines, the lines are not shown. All the other data, text is shown, but not a single

Azure AD B2C on Xamarin.Forms throwing error B2C 'authority' Uri should have at least 3 segments

I am trying to integrate Azure AD B2C into a Xamarin.Forms app. I am following THIS GUIDE as a starter. I have created Azure AD B2C tenant. When I open the endpoints of the tenant here is what I se...

How to stop getting "Refused to frame..." message with Azure AD B2C in a Blazor WebAssembly App

When setting up Azure AD B2C support for a Blazor app,
we are getting the error below when selecting the Twitter Identity Provider,
the flow works ok though when using Facebook Identity Provider.

Redis Client Side Caching for .Net

Redis 6 has introduced a feature supporting Client Side Caching and is described in here:
I tried out the ServiceStack.Redis and StackExchange.Redis clie...

libvlcsharp - how to force multicast from rtsp stream camera

I am developing an app in .net using libvlcsharp VideoView control.
I need to pull multicast streams from cameras and so I want to set the command line parameter --rtsp-mcast.
The purpose of the ap...

How to perform distributed combinatorial (N choose K) in Spark .NET?

I have a project where I have a large C(100,20) number of combinations with minor work being done for each combination set.
I am using Spark .NET with visual studio as my technology (see setup belo...

Encrypting web.config with aspnet_regiis works on local machine but fails when deployed to server

I have a web api application where i have encrypted the web.config using aspnet_regiis.exe. The application builds and works properly on my local machine but fails when deployed on remote server. It

How to filter related objects using Gremlin Cosmos DB?

I want to get a ResultSet of Objects that consist of a user and a list of all users that are not yet related to this user.
The result should look like this:
[[user: [USEROBJECT], usersThatAreNotFri...

Python 2.7 Filepath Regex match Too many )'s

I am trying to match a specific word in between backslashes in the windows file path of a file.
The value to match is "Psb+" for this case

IIS server connection problems after changing applicationUrl

I've set up a pretty basic API with .NET Entity framwework (basic weather forecast template). At the beginning everything was fine, the IIS server starts fine, but once I change the applicationUrl ...

Display "{application} has stopped working" message

I need to recreate the scenario where the windows popup "App.exe has stopped working" appears. I dont want to crash an particular application but I just need to make that pop-up reliably ...

Get currently focused element/control in a WPF window

How can I acquire the currently focused element/control in WPF from code that is part of neither a window nor an user control?

Force restore for a project where the framework is defined by the configuration

I'm trying to switch a solution over to use SDK-style csproj files and running into an issue. The below worked with the old version of csproj files.
I have a project with several configurations, wh...

Add image submissions to my ReactJS/.NET Web API CRUD application

I have a .NET Web API with a React/Redux frontend for a car dealership. I have full CRUD operations happening successfully, but I'm running into problems trying to use upload images now.
My vehicle

Error NETSDK1073: The FrameworkReference 'Microsoft.WindowsDesktop.App.WPF' was not recognized (NETSDK1073)

I'm getting "Error NETSDK1073: The FrameworkReference 'Microsoft.WindowsDesktop.App.WPF' was not recognized (NETSDK1073)" while trying to run my test project. Mine is a Xamarin.Forms app ...

.NET Web API unknown error for long running process

We are calling Web API from angular 6 application. It is taking more than 10 minutes to process the request. But after 10 minutes we are getting 500 unknown error in API response.
But if I check th...

How to generate symbols using other input symbols in dotnet new templating

In my template.json file i have this symbole that represents the name of a module :
"component-name": {
"type": "parameter",
"datatype": "text"...

Can a NetCore application config overwrite values from class library using Properties.Settings?

In NetFramework, you could have a class library with a Settings.Setting file which would ultimately feed a app.config file like this:
<sectionGroup name="

.Net Core API same url different tenant payload

I am working on a project which is not exactly multi-tenant, but we have multiple customers with on-premise apps and one of the requirement is to have a single codebase for all of them. Currently e...

VB .NET fast line graph shows large empty space on left and right of plotted data

In the example shown, there is 150 x-axis points of unwanted space on left and right the 150 points of plotted data (middle). Only 1/3 of the graph is used.
I plot 150 points for each of the 24

How to know the TLS version of the request?

I have a request that is coming in, I want to know the Tls version of the request
if (request.Properties.TryGetValue("MS_HttpContext", out context))
if (context is

How to work with Access attachment field from Windows Forms?

In Visual Studio, I have my data source set up from a local Access database file. One of the tables in that database has, among other things, several different fields for attachments (utilizing Acc...

How to run async form in background without deadlocking

Run Async Form in Background without deadlocking
FormA (see example below) is old and loads slowly due to lots of lazy-loading EF6 code etc. We've managed to speed it up with some async methods that

Where is best place to store external Urls

I have a .Net Core Web Api that takes data and then posts to another Api. I am not sure of where to store the URL endpoints for the external Api. The obvious candidate is the appsettings.json file....

Deleting a many to many relationship

i have come across other posts with this same question that also went unanswered but not giving up. I'm making a D&D-related project and i have Encounters and Creatures, these have a many to many

Is there a way to call .NET's console app native command line parser directly?

I've found that the native command line parser used by .NET console apps serves my needs well, especially how it interprets text enclosed within quotes as a single argument. Is it possible to make ...

Issue with RenderFragment in Blazor after leaving page with injected scripts

So, I've been learning how to create dynamic html in Blazor using RenderFragment,
most the test have worked ok so far, except when generating html which injects javascript that modifies the end res...

Is .NET Core == .NET Framework 5?

I have been looking for books to study the latest .NET Framework. As far as I know .NET is up to 4.6 but ASP.NET is up to 5(Core)
Is .NET Core the name for .NET 5 or are we still currently at .NET...

Error NU1605 Detected package downgrade

I am experiencing the following NU1605 dependency errors in my netcoreapp2.0 console application:
NU1605 Detected package downgrade: System.Diagnostics.Debug from 4.3.0 to 4.0.11. Reference the p...

EF Core event after entities materialized from database

To perform operations before/after entities are written to the database, I can do so before/after .SaveChanges().
How about after entities are read ("materialized") from the database - is there an...

How to get the colour of a Windows title bar text in .NET

I have 2 versions of a custom icon for my application.
One is half black and the other is half white.
I want to use a different one for the apps title bars depending on the darkness of the users &q...

docker-in-docker on free online gitlab runner

I have dotnet solution which consists of console project, webapi project and mysql db. I put them in separate docker images, wrote docker-compose to start and tested on my machine. Next, I wrote a ...

Silverlight: Invalid Attribute Type for TargetType="{x:Type TextBlock}"

Just playing around with Silverlight a bit and trying to set a style to apply to all TextBlocks. The following XAML:
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Margin" V...

WCF client cannot find configuration file

Consider the following situation:
A WCF host named preorderservice
A console exe named server.exe with engine.dll
engine.dll has a valid proxy to preorderservice
system.servicemodel is added to

WPF Treeview Binding, HOw do i display different data class as a Nodes Child?

Im trying to display a group (file extension and icon)(parent) then all of the files found in that group (child) in a WPF Treeview. I can get the groups to show in the treeview, each with an icon and

Transform XML in Powershell /.Net save result to a variable (type object) NOT a file

Hi All I an trying to transform xml stored as an XmlDocument object type using System.Xml.Xsl.XslCompiledTransform
I am trying to do this in Powershell.
The input xml is in the form of an xml obj...

Very Strange Binding issue: Commands & Custom Properties

Here's the top of my usercontrol:
<UserControl x:Class="MyApp.Common.Controls.Views.SimpleView"

ServiceSecurityContext is null with Castle Windsor WCF Integration Facility

I'm trying to use WCF Integration Facility with Castle. So far I have the server and the client working fine. The server is hosted in IIS 7 (with a SVC file with no code behind).
Now I need to kn...

The Service on local computer started and then stopped ,Some services stop automatically if there are not in use by other services or programs

I created one sample windows service and installed my service with successfully. But while going to START the service. I am getting below error.
This sevice on local computer started and then stop...

Installing Windows Service fails

I'm trying to install a .NET 4 Windows Service on a production server: Running InstallUtil.exe gives me this error message:
Exception occurred while initializing the installation:

Is there a simple way to register static closures with Castle Windsor?

I've been experimenting with using named delegates instead of single-method interfaces. This has some advantages for code size, as we can go from (some linebreaks removed so as not to overstate the...

Installing .net 4 project on target server - Error System.BadImageFormatException

I have installed the .net 4 framework on one of my servers.
When I run an installation project created in Visual Studio - get the following error:
Error 1001 Exception occurred while

Overwriting dlls in MEF

Right now, I'm trying to separate out a set of constantly changing classes into their own dll and dynamically load them using MEF. My problem is that whenever I try and overwrite the dll while the ...

Overriding MEF Composition

How can I override MEF composition so that if an importing constructor ask for a single dependency and there is multiple implementation of this required dependency it would take the implementation (

If an IoC container is not a Service Locator, then what's the point of it?

I am currently learning about DI and IoC containers to see if my application may benefit from using them.
At first I thought I understood what they are good for (namely to get instances of interfac...

How can a windows service programmatically restart itself?

I need to write robust code in .NET to enable a windows service (server 2003) to restart itself. What is the best way to so this? Is there some .NET API to do it?

There's a library for .NET that does financial calculations or implements Excel-like functions?

I'm working in a ASP.NET project wich is suposed to do several financial calculantions involving potentiations, nth roots, etc. For this first operations, I can easily solve the problem using Math....