Questions tagged [c#]
C# (pronounced "see sharp") is a high-level, statically typed, multi-paradigm programming language developed by Microsoft. C# code usually targets Microsoft's .NET ecosystem, which include .NET, .NET Framework, .NET MAUI, and Xamarin among others. Use this tag for questions about code written in C# or about C#'s formal specification.
1,619,598
questions
0
votes
0
answers
4
views
Attaching camera to rolling ball in multiplayer game
I'm working on a multiplayer game and it's kind of a mess, but I want to tackle each problem separately. For now, I want to attach the camera to the player. Problem is, the player rolls around, ...
0
votes
1
answer
21
views
The AddMonths method in C# PersianCalendar doesn't work properly
I wrote the code below and I want to add 4 months to "1402/12/29" and expect it to return "1403/04/31" value, but it returns "1403/4/29".
int persianYear = 1402;
int ...
0
votes
1
answer
32
views
dictionary, collision and linked list
If I understand the dictionary correctly, if a collision occurs, objects with the same hash will be placed on a linked list.
How will I know that multiple objects are under one key?
How can I access ...
0
votes
0
answers
14
views
Storing data in Settings.Default in isolation (a different storage location every time the application instance is run)
I create a Client-Server Application with gRPC in Single Project.
I save the network configuration in Settings.Default.
After I built the project, I copied the build results from the release folder to ...
0
votes
0
answers
7
views
MAUI .NET 8 - Absolute layout height size is not same as in Portrait and Landscape mode
In my MAUI project, I used AbsoluteLayout to define a UI design. However, I found that AbsoluteLayout height proportional is the same as in Portrait and Landscape.
The height size differs, For example,...
0
votes
0
answers
12
views
Google recaptcha V3 in windows service
I developed a Blazor webassembly and a rest api services as backend and I implemented a recaptcha V3 for more securty. All worked fine until I made a windows service. This windows service make a http ...
0
votes
0
answers
20
views
Why does a picker in a CollectionView set the SelectedItem binding to null?
I have a picker inside a CollectionView that should select a predefined item ColorNav but when it starts the item is not selected.
XAML:
<StackLayout>
<Label Text="...
-3
votes
0
answers
45
views
Extract substrings from strings that are separated by variable number of spaces [closed]
I'm looking for a regex to extract a part of the string in C# or vb.net.
My string might look like these
"Hello, there is cat on the wall. The lion is in its den."
"The lion is in its ...
0
votes
2
answers
33
views
How to get container of model in EditorTemplate, ASP.NET Core 8.0
I'm looking for possibility to retrieve container in EditorTemplate (ASP.NET Core 8.0).
In .NET 4.6 there is property for that:
ViewData.ModelMetadata.Container
but there is no such property in .NET ...
0
votes
0
answers
14
views
gRPC request aborted when sending large request
We have three services: an API, an orchestrator and finally an order service.
A REST request is sent to the API, it then calls the orchestrator service with gRPC, and the orchestrator calls several ...
0
votes
0
answers
8
views
Stop Visual Studio launching browser at Dev Tunnel address
I have a .Net 6.0 web application project and I've added a Dev Tunnels to the Visual Studio (2022 Version 17.11.0 Preview 1.1) project.
When running the project, I want to launch the browser at the ...
1
vote
0
answers
21
views
One side stream call with WebRTC flutter
I'm currently adding video call to my app (FLutter for front-end and Asp.NET Core Web + SignalR for back-end) I'm using the flutter_webrtc library. No matter how hard i try i just succeed to make the ...
0
votes
0
answers
4
views
RemoveClientAuthority() is not removing the authority resulting in issues with objects
For a Unity game I am developing I'm using Mirror. For testing, I placed a small cube, called TextBoxInteraction on the scene. I am using Steamworks, meaning I can host lobby and using Steam another ...
0
votes
1
answer
30
views
C# Entity Framework Core - Get Parent with filtered child collections
I have approximately next domain models:
public partial class ParentEntity
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public virtual ICollection<ChildA> ...
0
votes
0
answers
30
views
Can't Inspect variables in Visual Studio 2022
I can't inspect variables in Visual Studio 2022. Steps to reproduce:
1 - Get a new computer with Windows 10
2 - Install VS2017 Professional.
3 - Install VS2022 Professional.
4 - Menu->File->New-&...