509 questions
0
votes
1
answer
63
views
How use with Primary constructor bodies?
I saw in Microsoft learn site here option of use primary constractor body
with this example:
public class C(int i, string s) : B(s)
{
{
if (i < 0) throw new ArgumentOutOfRangeException(...
1
vote
0
answers
78
views
How to skip asynchronous method obfuscation
Configuration file
<?xml version='1.0'?>
<Obfuscator>
<Var name="InPath" value="." />
<Var name="OutPath" value=".\Obfuscator_Output" /&...
0
votes
1
answer
206
views
How to call PowerShell script to connect azure
I am facing an issue while connecting to Azure through the power shell.
could you please help me to resolve the issue?
code is below, please tell me where I am making a mistake.
we are using .net 7.0 ...
1
vote
0
answers
357
views
What does a readonly modifier for a method do?
I write this code
struct Test
{
public override string ToString()
=> "some text";
}
Then I get a compiler message suggestion IDE0251 Member can be made 'readonly'
this ...
0
votes
3
answers
79
views
ASP.NET Core installing package
I am new to ASP.NET Core and I am facing with this stubborn problem. When I try to download the Entity Framework Core for SqlServer, it return the error like the picture posted. I appreciate your ...
-2
votes
1
answer
637
views
How do i retrieve IFormFile from API and display it in view? i want the image(s) to be displayed in view
how do i successfully retrieve IFormFile from the server side API and display it in my view image source. I was wondering why what i did never worked until i realize that i was using the path i saved ...
0
votes
1
answer
62
views
Issue value of checkbox not affect on model property speakstuff when call action?
I work on asp.net MVC app . I face issue checkbox value not detected
changing value from true to false or reverse on model property speakstuff.
so I need if yes checked then true if no checked then ...
4
votes
3
answers
11k
views
ManagedIdentityCredential authentication failed: Access to the path ... is denied
My web application retrieves its secrets from our company's shared Azure Key Vault, and the permissions for that are granted via RBAC (role-based access control). This works great normally, but on my ...
-1
votes
1
answer
325
views
after click on submit button URL change How to keep it as it is without changes?
I work on an ASP.NET MVC razor page. I face issue Url change from
Resignation/RequesterIndex?filenumber=103085
to
Resignation/Create
after click submit button.
I need URL as it was before, without ...
0
votes
0
answers
21
views
Form misalignment
I create a form and set a specific size and when I run the program the displayed form doesn't match the previously set size.
For example I create a form and I add a panel with size 100x100. Then I set ...
0
votes
1
answer
57
views
API cannot be defined if there are two create tasks in two different controllers
I have two controllerbases and the tasks are almost the same but when I have the same create method the error occurs:
Here is the code in my program.cs class:
using DATA;
using Microsoft.AspNetCore....
0
votes
0
answers
72
views
System.InvalidOperationException: Unable to resolve service for type dependency injection .net core web api
System.InvalidOperationException: Unable to resolve service for type 'Pwc.EMSWebapi.IUserManagementService' while attempting to activate 'Pwc.EMSWebapi.UserManagementController'.
at lambda_method3(...
1
vote
1
answer
418
views
Why can I write local functions in .NET Framework 4.6.1.?
Local functions were introduced in C# 7.0 and C# 7.0 came in .NET Framework version 4.7.
I'm absolutely certain that I'm running .NET Framework 4.6.1., but I can write and use local function without ...
0
votes
1
answer
434
views
With EF Core 7.0 when SplitToTable, SplitTableBuilder.Property does not accept a lambda
The example from Microsoft looks like this:
modelBuilder.Entity<Customer>(
entityBuilder =>
{
entityBuilder
.ToTable("Customers")
....
0
votes
1
answer
2k
views
How do I configure System.DirectoryServices.Protocols.LdapConnection for a containerized LDAP server?
I've followed this guide to setup an OpenLDAP server in a container. When I run the container with TLS/SSL set to false, as follows:
sudo docker run \
--name openldap-server \
--rm \
--...
0
votes
2
answers
2k
views
How to succesfully connect with DirectoryEntry in C# to a localhost LDAP domain?
I'm running Ubuntu on Windows via WSL in a CLI, and I've configured LDAP (OpenLDAP: slapd) on Ubuntu as follows:
BASE dc=example,dc=com
URI ldap://localhost
When I run on the following command ...
0
votes
0
answers
42
views
How can I avoid Static Methods in my .NET Core Entity Framework App?
I have been repeatedly admonished for use of static calls in my Service Classes used in a Blazor Entity Framework App.
My problem is that I have Services that require interaction with other Services ...
0
votes
1
answer
136
views
label control does not update when I toggle light and dark mode
all other controls in my app are responsive to the app theme change caused by toggling appearance. Label control does not.
If I restart the application the text is the correct color, but when I try it ...
0
votes
1
answer
1k
views
Error when execute SQL from dot net core 7 cannot convert from 'string' to 'System.FormattableString'
I work on .net core 7 entity framework core . I get error when run my application on this function
error say cannot convert from 'string' to 'System.FormattableString'
public List<ApplicationDto>...
0
votes
1
answer
207
views
error when deserialize list to string when create new row blazor?
I work on asp.net core blazor i get error when deserialize list to string
so How to solve this issue please ?
error
Error: System.Text.Json.JsonException: The JSON value could not be converted to ...
2
votes
3
answers
164
views
Returning tuples from a method results in cumbersome usage pattern
I've been playing with returning tuples from methods, so method signatures like this...:
private int GetAlpha() {...} // -1 indicates an error
private bool GetAlpha(out int alphaOut) {...}
...turn ...
1
vote
1
answer
112
views
XML Reading returning an empty object. (XML Localization File)
C# (CSharp/.cs) 7.0
.NET Framework 4.7.2
I'm making a Localization system for a mod (based on the game's language), so I used an XML file to store translations, which look like this :
<?xml version=...
1
vote
1
answer
308
views
F#: How can I define a computed property in a type?
In C#, I can define a computed property as such:
public class MyViewModel
{
public DateTime StartDate { get; set; }
public string StartDateFormatted => StartDate.ToString("yyyy.MM.dd h:...
-1
votes
1
answer
301
views
What does it means class that implements IEnumerable<object[]>
What does it means class that implements IEnumerable<object[]> ? (in the specific case it is an abstract class but I'm not sure it is relevant)
Does it means that it should contains IEnumerable&...
5
votes
1
answer
9k
views
.NET Framework 4.8 seems to use C# version older than 7
It seems like I have got problems with vs not handing inline var declarations.
It turns out that is uses an old version of c#.
Here comes a screenshot that shows that out string link is not compiling.
...