Content
How to access azure keyvault through on-premise API using service principal and secret?
I'm trying to figure out how to access secrets in azure keyvault using an on-premise .Net Core 3.1 API. The authentication method is to use service principal and the client secret to access key vault. I'm following this tutorial from…


Copying code from documentation and license
When copying the code from the documentation (e.g. https://learn.microsoft.com/en-us/aspnet/core/web-api/handle-errors?view=aspnetcore-6.0) do you have to specify in your code where the given code came from and refer to the appropriate license?
How to implement custom elements in blazor 7 (Practical guide) ?
Hi everyone As you know, one of the new features of blazor 7 is custom elements. But there is not enough references & guides which demonstrate how to implement this. for example, I want to create custom element in my blazor server app, then consume…


BackgroundService - Is it possible to set parameter value?
Hi, I have a background service. I wonder if it is possible to set a parameter to this service from the Blazor Server application or in any other way? Thank you in advance.
System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:\MyApp\API\Live\Images\Company Logo.png'
Hi All, I am developing an application in .Net Core WebAPI in C#. I need to access company logo and insert it into excel while exporting data to excel. I have added Images folder with logo images to my startup WebAPI project in solution for this purpose.…


add one to one and one to many relationship
Hi So a little weird but im trying to add a one to one and one to many relatioship between two entites lets say i have two entities 1 is branch 2 is AppUser now a branch can have a app user as the branch admin(done through roles not the elephant in the…


Manage multirepo projects
Hello, I have to manage a multirepo project, i have three repositories (A,B,C) of .net projects and Im using visual studio 2022 latest release, my doubts are: Have I to have only one visual studio solution file? If yes where i have to store it? (in…
Add-Migration CreateIdentitySchema (2)
The tutorial below deals with authentication. One context is created when the project is first created at projectname.data.ApplicationDbContext; a second context is created later in the tutorial when scaffolding identity at…


LINQ OrderByDescdending for date field is not working razor pages
Hi, i want to display records based on booked dates. For that i used OrderByDescending in LINQ query, but it is not sorting based on date field. ManageBooking = await _context.ManageBooking.Where(e => (e.BookingDate >= DateTime.Today &&…


BackgroundService Serilog how to email?
Hi, In my background service, I would like to send error logs. Although there is an error, the email sink does not work. The error is being written to the file and mssqlserver successfully. Can you please share your experiences? Here is the…


Unable to bind the selected image file in Blazor file upload
"This question is updated with minimal sample as my old question doesnt give more info" I am learning blazor and c# fundas with a simple app.This app will allow you tobrowse all kind of files including images.As all kind files we can browse, i…


Define 2 roles for our ASP.NET Core MVC 6.0 (Admin & Users). if we do not have registration and we are authenticating users using MS Identity Manager
I created a new ASP.NET Core MVC 6.0 web application >> and i define it to use Microsoft Identity Platform for authentication, as follow:- so we do not manage or register users inside back-end. now we need to define all users to have…


System.InvalidOperationException: 'Invalid operation. The connection is closed.'
hello All, I am getting this error when calling a small function. I am calling this function twice. Below is my code: public async Task<EmployeeInfo?> GetEmployeeByEmployeeNumber(string employeeId) { List<int> emplyoeeInfoId =…


IEnum object True for All
Hi friends, I wonder if there is a way to use TrueForAll for IEnumerable<OrderDetail>? I am trying to check if all of the status = 1 or not. How can I check if all statuses in details are 1 or not? Thank you. var details =…


Getting lots of Task Canceled Exception while calling .net API from .net 6 WebApp
System.Threading.Tasks.TaskCanceledException: at System.Net.Http.HttpClient.HandleFailure (System.Net.Http, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) at…


Unable to add Token Providers when using multiple Identity Types
My application has two separate identity types. I created two types, as opposed to simply using roles, because the information I have to save about the types are pretty drastically different, and they use two separate applications that act on the same…


How to add activity source to tracer provider dynamically for a single service?
In the blog here, https://learn.microsoft.com/en-us/dotnet/core/diagnostics/distributed-tracing-instrumentation-walkthroughs , Its mentioned in the best practices for ActivitySource to consider creating a new one for each library rather than using a…


how to indoor asset position show on building map? and how to track them? in asp.net core
how to indoor asset position show on building map? and how to track them? in asp.net core
cookie can not read after downgrade from 7.0 to 6.0?
I am using .net 7.0 and after I downgrade to .net 6.0 I can not use HttpContext.User it is not authenticated. in F12 Cookie I can see the Cookie I have set but I can not read it why?
running application from linux arm using httpclient I have exception calling an api http with self signed certificate
Using dotnet 7 my application calls a https api service in my local network with self signed certificate. I run it from a Windows client and I have no problems. I run it from a linux arm raspberry device and I have the following exception: "One or…

