Questions tagged [.net]

Do NOT use for questions about .NET Core - use [.net-core] instead. The .NET framework is a software framework designed mainly for the Microsoft Windows operating system. It includes an implementation of the Base Class Library, Common Language Runtime (commonly referred to as CLR), Common Type System (commonly referred to as CTS) and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++/CLI.

Filter by
Sorted by
Tagged with
0 votes
0 answers
5 views

Azure Function - Add InvocationId with every log statement globally

I am writing an Azure function and I want to log the currently executing function's invocationId logged with the log message. I have a CustomLogger class utilizing the ILogger interface from dotnet. I ...
RKS's user avatar
  • 90
0 votes
1 answer
11 views

EF + Mysql 8.1 suddenly System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.UInt64'

I am suddenly getting from a simple EF query the error: System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.UInt64'. at MySqlConnector.Core.Row.GetUInt64(...
Sam's user avatar
  • 801
-3 votes
0 answers
26 views

CSV with Headers to key value pair [closed]

I have the following CSV data: code,bck,memo 0023256254,BW,Testing 0023256254,BW,Testing 123 I want to transform this to a list that has these lines as key value pair
John's user avatar
  • 257
0 votes
0 answers
22 views

Adding parameters into Razor pages routes

I'm building a helper tool for development purposes in .NET 7, to extract data from different data sources to save having to manually write queries. I want it to run over multiple environments and to ...
JonWillis's user avatar
  • 3,146
0 votes
0 answers
47 views

MissingManifestResourceException error with MenuStrip and how to fix it

I am trying to migrate old project (game editor) from visual studio 2008 with net 2.0 seems like to vs 2022 with net 4.8, sadly i am badly familiar with dotnet and got stuck with error during editor ...
taburetka's user avatar
0 votes
0 answers
10 views

Can SQLSugar LIbrary cause error ORA-12537 and ORA-12571?

First of all I just want to clarify that this system was created a few years ago by another team at a different company site and is in constant use. Therefore some main features cannot be changed. We'...
dan04's user avatar
  • 13
0 votes
0 answers
33 views

How to run parallel operations on set of files? C#

so I'm trying to run parallel operations on a set of files using C#. The first operation converts the file type and stores it in a temporary folder. The second operation does some processing to the ...
brendan3900's user avatar
0 votes
1 answer
28 views

Entity Framework cannot find stored procedure

I have an application that I am updating. I've added a stored procedure to the database, tested it and it is working. I then updated the ADO model in the application. The stored procedure is showing ...
C. Michael Warden's user avatar
0 votes
0 answers
17 views

Customize FontImage Size of ToolbarItem in .NET MAUI App

I created a .NET MAUI App for Android Phone and Tablet and WinUI. I am looking for a solution to make FontImage fit all those three formtypes. The FontImage of ToolbarItem by default appears in proper ...
user3192557's user avatar
0 votes
0 answers
23 views

Create NuGet package with static CSS and JS files for ASP.NET Core 6 MVC project

I need some help for creating my NuGet Package from an ASP.NET Core 6 MVC project. I created a MVC project because I want to share CSS, JS and _Layout files. After installing the package in another ...
Deizo's user avatar
  • 17
1 vote
0 answers
17 views

Unable to cast object of type 'System.Linq.EmptyPartition1[Model]' to type 'System.Collections.Generic.List1[Model]' using EFCore.BulkExtensions

I'm using EFCore 7.0 and EFCoreBulkExtensions 7.1.2 When I'm trying to execute a _context.BulkUpdate(list, bulkConfig); It thows an <System.InvalidCastException>: Unable to cast object of type '...
Luis Santos's user avatar
0 votes
0 answers
14 views

How to call keras.backend.function from Keras.NET

General question, how can one call the equivalent of keras.backend.function() from C#? Desired goal from python: S = K.function([model.layers[0].input], [ model.get_layer('S').output])([...
debo's user avatar
  • 372
-3 votes
0 answers
31 views

Adding singleton to .NET 4.8 Web API

With .NET 6.0/Core it is possible to add a singleton using services.AddSingleton() to startup.cs Now that I have created a .NET 4.8 Web API there is no startup.cs. Is it still possible to add a ...
Ethan Hoekstra's user avatar
-1 votes
0 answers
18 views

Upload Excel data and insert it into the database using ExcelDataReader [closed]

I am trying to read data from excel upload and insert it into the database. But cannot insert the data successfully. While debugging I found that the date of order stores null value while in the excel ...
Ashley Ferns's user avatar
0 votes
0 answers
42 views

Azure Function not running with failure message as "The user name or password is incorrect"

Out of blue, I am getting below error when trying to run azure function app url from browser. When i started to explore about issue , I found a few check list . checked ...
PavanKumar GVVS's user avatar
0 votes
1 answer
20 views

ASP.NET cookie value null

I have cookie that I create in a Login page and the read in the Home page Login: HttpCookie cookie = new HttpCookie("Login"); cookie.Values["User"] = textBox.Text; cookie.HttpOnly =...
João Pedro Sousa's user avatar
-1 votes
0 answers
32 views

HttpClient and blocking PostAsync

I know it is a popular C# question. However I think my question is specific. I plan to do two requests to the web server. First request is a long GET. The webserver does not reply immediately, wait ...
Petr's user avatar
  • 1
0 votes
0 answers
16 views

I have a 'interop exception' with a consumer contract test under dotnet

I had code working with pact v3. I have upgraded to pact v4, and have followed the instructions in the upgrade guide. When I run a pact consumer test I get the following error: Message:  PactNet....
Stave Escura's user avatar
  • 2,068
1 vote
0 answers
15 views

Reusable Expression with IQueryable in LINQ Query

I am trying to create a reusable Expression with an IQueryable (and also int) and input in a LINQ query. The basic version looks like this and it works fine Expression<Func<Insurance, ...
Eric's user avatar
  • 11
0 votes
0 answers
6 views

How to use NEST V6 and NEST V7 together in .NET?

I would like to use two different elasticsearch (V6 and V7) and to do that I need to use different versions of NEST (V6 and V7). I found a tutorial that describes the problem and a possible solution: ...
tomas's user avatar
  • 67
-1 votes
1 answer
19 views

IBM MQ MFT with .Net Framework (File transfer) need references [closed]

I am trying to implement IBM MQ MFT file transfer using .NET Framework but the provided IBM documentation is bit complicate to implement also could not able to find any samples regarding it, Is there ...
Supriya Chandrasekaran's user avatar
0 votes
1 answer
27 views

MAUI Picker style in Windows Platforms

I am trying to change the default style of the Picker control in MAUI but cannot find a solution. I would first like to remove this highlighted rectangle in the picture: I had the same problem with ...
Yoji's user avatar
  • 51
-2 votes
0 answers
28 views

Reconnect events to windows forms

I have just got a colleagues code from GIT. On his PC all events in the windows form works. However on my PC the designer does not pickup all events, even when the events is there in the code. Any ...
Thomas Segato's user avatar
0 votes
0 answers
23 views

Is it possible to host same site on IIS and Azure App Service

We have a SAS application that is hosted on IIS server on-prem with many subdomains. Most of the code base is in webforms and we are in process of converting to core one service at a time. My question ...
Prashanth 's user avatar
0 votes
1 answer
38 views

A key cannot be configured on 'Foo' because it is a derived type. The key must be configured on the root type 'ApplicationUser'

I got this error on db migratios: A key cannot be configured on 'Foo' because it is a derived type. The key must be configured on the root type 'ApplicationUser'. If you did not intend for '...
Sachihiro's user avatar
  • 1,619
0 votes
1 answer
37 views

Integration test sqlite in memory database give error in .NET Core

I setup integration testing in my .NET Core application but in line number 53 (i.e appContext.Database.EnsureCreated()) I get an error: $exception {"SQLite Error 1: 'near "''": syntax ...
Akash Kumar's user avatar
0 votes
0 answers
74 views

How to efficiently Read and Update Thousands of Entities using EF Core [closed]

I'm working on a solution built using .NET Core 7 and EF Core, and I'm facing performance issues with a specific method. This method is responsible for performing a series of actions, and I'd like ...
Alisbha Khan's user avatar
0 votes
0 answers
16 views

Printing PDF but the left side is cut out. Using PdfiumViewer and System.Drawing

I developed an application to print documents. During testing it seemed to always cut a litte bit of the side of the document, sometimes half of the first character of a line. I noticed it myself ...
Gustavo HK's user avatar
0 votes
2 answers
51 views

Generic class for this JSON file

I have a question which involves data modelling. I have to develop two projects. which involves localization (Backend API, Frontend angular). The purpose of the backend is to execute CRUD operations ...
Emirhan Demirci's user avatar
-1 votes
0 answers
24 views

Wrong 1.0.0 version number in a C++ project's dep.json file

I've faced a strange issue during .NET target upgrading of a C++ project. I saw that there is a [PROJECTNAME].deps.json file created in the output folder, you can see the content below: { "...
olhptr's user avatar
  • 65
0 votes
1 answer
29 views

.Net 7 razor pages routing

I added a Terms page in Pages folder like so: Pages Folder so now I am able to visit the page like https://localhost:7135/Terms. I have 2 problems. #1: Now I want to change the page to terms-and-...
K V Sharma's user avatar
0 votes
0 answers
12 views

Masstransit publish message to multiple Queues by single exchange

i write simple project with by using #Masstransit and #RabbitMq . I wanna to publish some messages to #RabbitMq bus and use single Exchange to Route my message into suitable Queues (My Mean to use #...
Mohsen EbrahimNezhad's user avatar
0 votes
0 answers
52 views

For a SingletonObject, Why can I add dependency on a Transient object but not on a Scoped object in C#? [duplicate]

I am writing an Azure function and I have 2 classes Dependent and Parent. The below code shows the dependency chain. Dependent uses instance of Parent class. public Dependent(Parent parent) { ...
RKS's user avatar
  • 90
0 votes
0 answers
24 views

Does the "Executed DbCommand" logging statement in .NET EF Core includes latency?

I have a question regarding the "Executed DbCommand" statements output by the Microsoft.Extensions.Logging mechanism in a .NET project utilising EF Core. Namely, does the time logged in this ...
Nikola Vetnić's user avatar
0 votes
0 answers
33 views

Getter fallback functionality

I have a class with some getters with fallbacks: WebPageClass { public virtual string Name { get; set; } public virtual string Title { get { var title = this....
Jon Anders's user avatar
0 votes
0 answers
17 views

Can ı put together my request and response logs in one document

This is my logs I am using Serilog, Elasticsearch and kibana for logging. When I send a request, serilog logs 4 different documents for 1 request. I can't see my response and request logs in 1 ...
Serdar Yiğit Yanık's user avatar
-1 votes
1 answer
44 views

Difference between LINQ statements? Position of select

Is there a difference between the following LINQ statements? var value = source.Select(y => y.Id).Where(y => !string.IsNullOrEmpty(y)).ToList(); var value = source.Where(y => !string....
TheAnonymousModeIT's user avatar
0 votes
0 answers
5 views

How to connect two devices connected over internet and behind a NAT

The situation is that I am trying to connect two local devices which are behind a NAT ( possibly a strict NAT ) to share images and text. I also have a VPS that is having a public IPv4 address ...
Arjit Malik's user avatar
-2 votes
0 answers
32 views

Set control visible=true to session then set control visible =false why change control visible property in session

pnlCreate.visible =true Session.Add("ctrl", TryCast(pnlCreate, Control)) pnlCreate.visible =false 'when go next page 'read session pnlCreate is hidden
HTarda's user avatar
  • 87
0 votes
0 answers
24 views

crash issue in .net application - windows 10

I needed some help to debug a crash in windows .net application. We have a .net plugin running (written in c#) and it has crashed once during automation testing , we dont have a coredump or any logs , ...
Aditya Desai's user avatar
-1 votes
0 answers
26 views

Format of the initialization string does not conform to specification starting at index 0. .NET API [closed]

I'm trying to create an admin login in an ASP.NET Core 6.0 Web API project, but the error message shown in the title appears. I checked other posts that talked about this and I didn't find anything ...
Albi Tushaj's user avatar
0 votes
0 answers
26 views

Is there a way to get parameter names and their respective types from a T4 template?

Context I am writing a program in C# which is a front end for T4 templates. It will create text for standard issues, etc. I want to make it easily expandable, so that I just have to add another T4 ...
Endet's user avatar
  • 1
0 votes
2 answers
40 views

Asynchronous operations on a System.IO.Pipes named pipe

I have implemented a simple NamedPipeServerStream / NamedPipeClientStream solution, where I want the client to be able to send requests, but also receive responses, and I never know which order they ...
Helena's user avatar
  • 1,043
2 votes
2 answers
91 views

What is the proper way of autoincrementing non primary key column?

I have a table which has an integer field which is supposed to be unique and autoincremented. After doing some research I came up with two different approaches: Case A modelBuilder.Entity&...
theuserthatpretendstobesmart's user avatar
0 votes
1 answer
24 views

XML contains element with the namespace as empty URI breaks deserialization

I have an XML with the following structure: <?xml version="1.0" encoding="utf-8"?> <ClientInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http:/...
user2838376's user avatar
-2 votes
0 answers
34 views

What is the best way to run a .NET console application from a Python desktop application? [closed]

I have a .NET console application which, in turn, sends requests to a server. I also have a desktop application, written in Python, that needs to send requests to the same server. As things are, it is ...
razumichin's user avatar
0 votes
0 answers
23 views

.NET Core 3.1 custom ClaimsPrincipal not working correctly with AddAuthenticationSchemes policy

My .NET Core 3.1 app has one authentication scheme (cookie authentication with OpenId Connect) and I'm planning to add another authentication scheme. The other authentication scheme will only be ...
Randy's user avatar
  • 543
0 votes
1 answer
40 views

Need information about the parent of a child component for conditional rendering in Blazor

So, I have two projects, say ParentA and ParentB. I need to load a modal that shows different text when loaded in ParentA project and a different text when loaded from ParentB. The modal is present in ...
Harshal Bhoir's user avatar
0 votes
1 answer
25 views

Azure Build Pipeline fails when having a Source-Generator

I created a source generator using the IIncrementalGenerator Interface provided since .NET6. When I run the build locally everything works fine and my files get generated. Even when running a local ...
Mitar's user avatar
  • 1
0 votes
1 answer
33 views

Validation model of Password (Razor Page)

In my pageMode Code l` public class LoginViewModel { [Required] public string LoginId { get; set; } = null!; [Required] public string Password { get; set; } = ...
ha169169's user avatar

1
2 3 4 5
6688