Questions tagged [.net-core]

.NET Core is an open-source successor of the .NET Framework. It can be used in a wide variety of applications and verticals, ranging from servers and data centers to apps and devices. .NET Core is supported by Microsoft on Windows, Linux and macOS.

Filter by
Sorted by
Tagged with
-6 votes
0 answers
21 views

I want to create add-on at adobe pdf using C# [closed]

I want to create add-on at adobe pdf using C# there any guideline to starte to implement , i trying to download the SDK for adobe Acrobat, there isn't direct link to download it , if any developer ...
Risk's user avatar
  • 91
0 votes
0 answers
6 views

Efficient Database Operation Execution in MassTransit.Worker Across Multiple Servers

I am currently working on a project where I have implemented a MassTransit.Worker with a RabbitMQ consumer that performs database operations upon receiving messages. The challenge I am facing is ...
Hardik Dhuri's user avatar
0 votes
0 answers
20 views

How to publish a net cross platform application without rebuilding it and without restoring it?

Let's say I have simple Hello World cross platform app which I need to work on both win7-x64 and linux-x64. <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <...
isxaker's user avatar
  • 8,676
0 votes
0 answers
22 views

Service Worker Push Notification API Subscription .Net Core 6

I have been stuck on this one for a few days and have worked through many issues. I must be missing something simple but not sure what it is. I got a lot of this code from other samples I have found. ...
nathan's user avatar
  • 47
0 votes
2 answers
51 views

Passing C# function in constructor to be used as a subscriber to EventHandler delegate

I've been spending some time learning about Delegates in C# and have wired up a small Windows Form app containing two forms to test them out. My goal is to have the AddContactForm push new Contact ...
Acadian_Ghost's user avatar
0 votes
0 answers
19 views

SignalR - Error: Server returned handshake error: Handshake was canceled

I'm developing a webapp on Azure that creates an application with signalr. Localhost I can communicate normally, but when I publish to Azure, I receive a Handshake error. I have no idea what it could ...
Erisonson's user avatar
-1 votes
0 answers
35 views

What are all differences between ending a Process by using `return`/`throw` and `(new Process).Kill()`?

If any, and except the way these commands are used . Does (new Process).Kill() prevent any parts of .NET from running ? Cleanup and etc . Except Finalizers, because they aren't running on .NET 5+ and ...
irvnriir's user avatar
  • 708
0 votes
1 answer
25 views

ASP.NET Core Razor - redirecting from a dependency injected service

I'm building a Razor pages website. Users are required to login to access the website. I have a controller behind the login, e.g: [Authorize(AuthenticationSchemes = CookieAuthenticationDefaults....
gbgr's user avatar
  • 13
0 votes
0 answers
11 views

Connect Blazor WebAssembly to Dataverse with Dataverse ServiceClient

Is there a way to access the Microsoft Dataverse ServiceClient from a Blazor WebAssembly app. Or alternatively, another class that implements IOrganisationService? when i try to connect i get ...
Steini's user avatar
  • 405
0 votes
1 answer
35 views

Deserialize Json input to dynamic

I want to deserialize a Json document without knowing anything about its content (can't use a strongly typed .NET class). I was using the following code with Newtonsoft.Json to deserialize to dynamic: ...
Benjamin Talmard's user avatar
0 votes
1 answer
77 views

The LINQ expression could be translated

I want to apply some advanced filtering in EF core but getting error; Here is my code: private IQueryable<AppDataUsage> PrepareDataUsageFilter(IQueryable<AppDataUsage> dataUsageReports, ...
Ask's user avatar
  • 3,208
0 votes
0 answers
19 views

AWS Lambda using Annotations framework for .NET - missing Role

I'm porting to AWS Lambda functions an entire .NET 6 web application, using AWS Lambda Annotations framework. With each build, the Amazon.Lambda.Annotations package takes every annotated API method ...
steficol's user avatar
0 votes
1 answer
70 views

Azure ad connection Client MVC C#/ angular 14 - Api netcore v7/8

I'm trying to connect an MVC C#/Angular 14 client to a Netcore 7/8 API via Azure AD, as shown in the screenshots below, the client-side integration is ok. When I submit the received bearer token to an ...
cfelix's user avatar
  • 11
0 votes
1 answer
10 views

Setting specific Routing Key to all Receive Endpoints in MassTransit

I have a microservice which has over 15 consumers. I would like to know if it is possible to set a RoutingKey for all of the receive endpoints without manually configuring each of them please. I tried ...
mdx0111's user avatar
  • 129
0 votes
2 answers
39 views

How to convert windev function code to C#

I want to convert a function of a windev program to C# .net core 6 web api project controller function. Example code: sLic is string ANSI = sAPPLICENSEID+";"+SAI_License_Number; sRes is ...
Dinushe Jayasekera's user avatar
2 votes
1 answer
68 views

Generic Type Inference with ReadOnlySpan in C#

I'm trying to create a method that operates on a generic ReadOnlySpan<T>, so that I can pass an array or a stack-allocated buffer without changing my code. I also want to restrict the type T to ...
frasten's user avatar
  • 100
0 votes
0 answers
35 views

How to override Dictionary's get_Item?

After reading this answer, I'm finding that my fake of IRequestCookieCollection throws when the requested item is not present. Message:  System.Collections.Generic.KeyNotFoundException : The given key ...
OutstandingBill's user avatar
0 votes
1 answer
32 views

.NET 8 / WCF - The value of this argument must be positive. (Parameter 'size')

After updating from .NET 6/7 to .NET 8, we get this exception when trying to invoke a call to a WCF endpoint using nettcp binding. The value of this argument must be positive. (Parameter 'size') ...
fiat's user avatar
  • 15.6k
0 votes
1 answer
23 views

Missing .html file for Blazor .Net 8 Web App - When published with JetBrains Rider

Am i supposed to create one from another file, or? I am hosting through GoDaddy, and the page is somewhat loading so its definitely pushing to the host... But theres no index.html in the wwwroot ...
Joshtralia's user avatar
0 votes
0 answers
70 views

Changing MainPage of a Maui app breaks OnBackPressedDispatcher callback

I have upgraded my Maui app to use .net8 and target Android 13. In doing so, I am trying to eliminate the deprecated base.OnBackPressed(); but I am running into an issue. Old logic: // MainActivity....
Mike Luken's user avatar
0 votes
0 answers
16 views

.Net Core API with VUE Spa

I am trying to host a vue spa client within my api's wwwroot folder. I have set up build scripts to build the spa into the folder and that works well. I also use app.UseSpa() to proxy request in case ...
E F's user avatar
  • 13
-1 votes
0 answers
47 views

Is there a way to wait for a ManualResetEventSlim to be Reset()?

The call ManualResetEventSlim.Wait() waits for the event to be set. I need the opposite, it has been set and I'm now waiting for it to be reset. Is there a way to do that? I can't flip my event object,...
David Thielen's user avatar
0 votes
1 answer
83 views

POST Request to .net Core 7 Web API Returning Empty String

So I am using the following C# code running on localhost to send a POST request to a .net Core 7 web api deployed on IIS 10. I can make successful GET requests using the C# code, however the POST ...
parrigin777's user avatar
0 votes
0 answers
31 views

Is it safe to inject the Hangfire BackgroundJobClient as Transient?

I have a .NET 7 project that once a day creates a job that creates other jobs. The main job exists in a service, and the sub jobs each have their own services. Is it ok to inject the ...
Cef's user avatar
  • 701
0 votes
0 answers
24 views

Index error after adding new lookup/type value

I get an index error on customertype. I am new to EF so be patient with me. I have a desktop application in .net core. With a form with fields from customers, one of those fields is a dropdownbox with ...
Justme's user avatar
  • 1
0 votes
0 answers
17 views

SerialPort.GetPortNames throws exception on Android

I'm writing a MAUI App using .Net 8, and I need to connect to a serial port. However, when calling the static System.IO.Ports.SerialPort.GetPortNames() method, I get a System.Reflection....
erict's user avatar
  • 1,404
1 vote
1 answer
15 views

Placing dotnet scaffolded files in Models folder

I successfully executed: dotnet ef dbcontext scaffold "Host=myDbServer;Database=profiles_editor_data;Username=myUsername;Password=mypassword" Npgsql.EntityFrameworkCore.PostgreSQL However, ...
Jose Cabrera Zuniga's user avatar
0 votes
0 answers
47 views

How to register a database connection, such as npgsql, with .NET Dependency Injection without relying on EF, Dapper, etc

I have a pretty simple service using Postgresql as the database. It is just a few tables, with a few columns for indexing and the rest of the data is stored in a jsonb column. Since it's so simple ...
Stephen Gilboy's user avatar
0 votes
0 answers
66 views

ASP.NET Core Web API deployed to IIS 404 Not Found - No candidates found for the request path '/'

I've been stuck with this for a while now. Tried all solutions I found but still no success. I've tried modifying Program.cs, web.config, installed .NET Core bundle, .NET SDK, ... nothing helped. I ...
user23008303's user avatar
0 votes
0 answers
33 views

Entity Framework error: SqlException: Cannot insert explicit value for identity column in table 'SiteCategory' when IDENTITY_INSERT is set to OFF

I have three tables Tags, TagCategories and SiteCategory. TagCategories has two columns; one is the index of Tags and the other is the index from SiteCategory; that means that between Tags and ...
muhammad tally's user avatar
0 votes
0 answers
14 views

RabbitMQ : Ensuring Message Order and Consumer Affinity in Microservices application when there are many active instances of the same consumer

I'm currently developing a Dot Net 7 microservices architecture using RabbitMQ, and I'm encountering challenges with message consumption. My setup involves a topic exchange and queue binding to ensure ...
Ahmed Nasser 's user avatar
0 votes
0 answers
21 views

I need to X-unit test in ASP.NET Core Web API for authorizing API using cognito

I am using OAuth 2.0 for authentication using aws cognito also using ASP.NET Core Web API for backend when I testing authorize API using the code shown here, but the test didn't pass and I got the ...
Shauij Msw's user avatar
0 votes
0 answers
11 views

How to show logs in kibana from a .NET Core project which is deployed on docker [closed]

I have added Elasticsearch and kibana in my Docker compose yml file and I could load kibana as well but don't have any idea on how to see logs in kibana. I have tried adding data but it asks me for ...
Janki Chokshi's user avatar
0 votes
1 answer
44 views

ASP.NET Core application in K8S sometimes hangs on HostBuilder.Buid()

I have an ASP.NET Core 6 application running in Kubernetes. During startup it simply runs typical code for a starting ASP.NET Core application. It now suddenly started to often, but not always hang ...
JvS's user avatar
  • 305
1 vote
2 answers
62 views

Adding a custom claim in Azure B2C using user flows

Using an external IDP in azure B2C. Is it possible to add a custom claim to the JWT without using custom policies? In my IDP I have this code in the /connect/token endpoint: This works as expected and ...
martenolofsson's user avatar
0 votes
1 answer
17 views

Is it possible to configure relationship between 2 classes just using ids instead of navigational properties?

I have 2 classes and I want to avoid using navigational properties. So instead of: public class A { public int Id { get; private set; } public B B { get; private set; } } public class B { ...
Yoda's user avatar
  • 17.5k
0 votes
0 answers
44 views

FluentValidation - returns default response when object is NULL [duplicate]

I hope you are well. I have a question to ask you. There is an architecture I use for a project. I'm using fluentvalidation on the server side. I have no problems with all the validations I use, but ...
OsKyy's user avatar
  • 33
0 votes
1 answer
54 views

What configurations do I have to add to my DbContext to store property of type IDictionary<string, object>

I have a domain entity in my code where i have property Parameters which is of type Dictionary<string, object>. I have tried to add JsonConvert. But the data gets changed while storing in db. ...
Hardik Dhuri's user avatar
0 votes
0 answers
14 views

itext7 with pdfocr in .net core application. compatibility problem

I need to read PDF image in .net core 6 application. i am trying it with itext7 and pdfocr but i am getting error Severity Code Description Project File Line Suppression State Warning ...
Kamran Shahid's user avatar
0 votes
1 answer
36 views

Can't install Npgsql.EntityFrameworkCore.PostgreSQL in my .NET 7 app

I was following the next video to add support for EF with PostgreSQL: https://www.youtube.com/watch?v=pRxG9ORD7Hk Yet, I got the next results while trying this dotnet add package cmd: #dotnet add ...
Jose Cabrera Zuniga's user avatar
2 votes
1 answer
26 views

Is there any "Analyze and Code Cleanup" tool for .NET project in VS Code or .NET CLI?

In Visual Studio 2022, there is a Analyze and Code Cleanup feature which is really good. I'd like to know that is there any equivalent tool I can use in VS Code or in .NET CLI or in MSBuild?
Will Huang's user avatar
  • 3,031
0 votes
0 answers
55 views

How can I embed a large string in a .NET application in a Linux dev environment [duplicate]

I have a .NET 6 web application and I'd like to embed a large static string in it. The string is roughly 350 kB large. The usual answer especially for .NET Framework would be a resource file, but I'm ...
Fabian's user avatar
  • 471
0 votes
0 answers
11 views

Does the dotnet command have an equivalent of Visual Studio's "AccelerateBuildsInVisualStudio" config value?

The build acceleration feature was added to Visual Studio and described here. I've added the Directory.Build.props file alongside my solution file, and it works as advertised...when building in Visual ...
Brett Zook's user avatar
1 vote
0 answers
41 views

Openiddict with 2FA/MFA using Code Flow with username and password?

Been using openiddict for years, using the password flow, where a user just passes a username and password, which works perfectly! But it seems that we now need to support 2Fa/MFA on a user by user ...
Gillardo's user avatar
  • 9,638
0 votes
1 answer
63 views

.NET EF Core UpdateData based on other columns

I have table with columns: Id Field Operator Value 1 "one" "contains" "o" 2 "two" "contains" "o" I want to merge columns "Field&...
A. Gladkiy's user avatar
  • 3,220
0 votes
1 answer
26 views

Using Directory.Build.props to copy files from different projects to output dir

I have a solution with a few class libraries and a console project. Each one of the libraries have an Inputs dir next to the .csproj file with a bunch of files. I'm currently doing this in each one of ...
eduherminio's user avatar
  • 1,546
0 votes
0 answers
26 views

Unable to get Configuration object using validationContext

I am working an API application, I am using ValidationAttribute class to write custom validator for my inputs. I have encountered a situation where I need Configuration object to read some values from ...
SwapnilKumbhar's user avatar
0 votes
1 answer
47 views

Entity Framework Core 7 - Entity combined with polymorphic JSON Column, is this design currently possible?

I am trying to solve a generic domain problem using Entity Framework 7.0 features of JSON Columns, intermixed with more concrete domain entity models & properties, but I am struggling to see if ...
watdo's user avatar
  • 677
0 votes
0 answers
45 views

Using EntityFramework for Visual FoxPro

I need to make a scaffold operation to generate my Models .NET CORE with EntityFramework for local file .DBC of Visual Fox Pro 9.0. It is possible?
Pierantonio Bonato's user avatar
0 votes
0 answers
80 views

The ConnectionString property has not been initialized in .NET 8 with EF Core 8 and SQL Server 2022

I am working on a .NET 8 application using Entity Framework Core 8 and targeting SQL Server 2022 (Express Edition). Despite having a correct connection string in my appsettings.json, I am encountering ...
strasouch's user avatar

1
2 3 4 5
889