hutonahill
✅ IIS?
Soooo.. i tried to run my ASP.NET project and rider threw an error i had never seen before.
It said i had to set up IIS. i though what the heck, you didn't need this 20 min ago. but I clicked the link to the settings and followed the instructions.
I think i installed iis, then i wanted me to install ASP.NET Core module. I clicked the doc page and, found the Microsoft link for the install, rebooted and i am done.
but i am not. still doesn't work. While rider filled in the IIS express root folder on its own it did not fill in the ASP.NET core module file location.
1) what on earth is IIS?
2) why didn't i need it 20 min ago? only major change i made to the code was adding a hosted service
3) Where is the file location for ASP.NET Core module?
(going to sleep, then oral surgery, then more sleep, so i am going to be delayed getting back to this.)
104 replies
✅ using using to clear up ambiguous references.
I've to two method called index:
Microsoft.EntityFrameworkCore.Index
System.ComponentModel.DataAnnotations.Schema.Index
i don't use the 2nd one. I want every mention of index to be interpreted as the first one.
I've tried adding one of these using's to fix the problem, but nether works, it just says it Cannot resolve symbol 'Index'
36 replies
Trying to scaffold a MySQL database with Rider
I am trying to scaffold a MySQL database. I am using Rider. I found this article on the MySQL website:
https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core-scaffold-example.html
but the commands it uses seems to require Visual Studio which i am not using.
then i found this article from Jetbrains themselves:
https://blog.jetbrains.com/dotnet/2022/01/31/entity-framework-core-inside-rider-ui-way/#alternatives
58 replies
Temporary Pause
I am using .NET 8
I've got an ASP.NET API that i would like to pause. The goal of this is to prevent any endpoints from being called for a short amount of time. I could do this procedurally with a constant variable that's checked, but I would rather not send nothing.
Is there some kind of HTML code i could return that would indicate that the API is offline but like on purpose? Instead of just returning nothing.
I also need a way to return this response to the user when they try to access the API while its paused. Is there a way for be to disable all the endpoints and run a default endpoint?
10 replies
✅ Windows Audio Capture
Building an XAML application. The eventual goal is to capture an audio source and stream it to another application using webhooks.
This is my first time doing:
1) XAML
2) Audio anything
3) Webhooks
i detect audio sources with this method:
Then i use these methods to start and stop recording
I added a volume bar so i could see the audio being captured and the audio bar gets set to 0 when i pick an audio source (its one if the mic is null). I think this means i am not capturing audio. but i don't actually know.
How do i even debug this?
2 replies
✅ using
I keep seeing variables defined within a using, like
what is using? why do people use it? what are the risks of not using it?
I think this just disposes of the connection variable (for sure) after its done, but i see it used mostly when dealing with databases. is there a reason for this. If my variables are within a method they get disposed at the end of the method right? How concerned should i be about this?
16 replies
How does signInManager return tokens?
I am modifying the standard login endpoint provided by
MapIdentityApi<IdentityUser>()
. at the bottem of the login endpoint: // The signInManager already produced the needed response in the form of a cookie or bearer token.
i assume this means that somehow signinManager returns its tokens to the users. I need the login endpoint to return some other data depending on the roles the user has. I've implemented this logic, but i cant figure out how to return the sign tokens as well as my data. it also looks like that even when my users don't have this role the method is not returning tokens, its just returning an empty success.
How does signInManager return tokens to the user and how can i get it to return that data to my method so i can control how its returned to the user?6 replies
API does not deploy in debug mode
when i try to test my API in debug mode it tries to open the swagger page but i get an unable to connect. the most confusing part is this doesn't happen every time, most of the time i can restart the api (still in debug mode) and it now works, but its getting more and more frequent and i am starting to be concerned.
21 replies
Identity 2FA wont enable
working in implementing my own login procedures.
I've got a /register endpoint. this is mostly like the default, but it enables/resets 2FA.
The issue is when i try to log in it says 2FA is not enabled for the user.
as far as i can tell
await userManager.SetTwoFactorEnabledAsync(user, true);
should flip that switch that requires 2FA but its not? is this something i have to change in set up? some option to change when i add identity?4 replies
✅ Identity Services Registration not working
I declare a class to handle 'email':
Then in Program.cs I register the service:
Finally i try and grab the service and it throws an error
Everywhere i look it people use this same method to register the emailsender, so i am not sure what i am doing wrong.
14 replies