C
C#5mo ago
hutoanhill

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.
11 Replies
becquerel
becquerel5mo ago
what output do you get in the terminal when you run it and it fails? and/or, what is the specific error message?
hutoanhill
hutoanhillOP5mo ago
no errors, just blank. will post a screen shot once i get back online (probubly a few hours) of corse, now that i try to reproduce the issue its not happening :(
Anton
Anton5mo ago
I've been having the same issue lately
hutoanhill
hutoanhillOP5mo ago
good to know i am not crazy eventualy it will start happening again and i will post some screen shots
Batuhan
Batuhan5mo ago
you may have problem in your controller. For instance get methods with the same name or post methods. Your route could have some missmatching. It is hard to detect the problem without seeing the code.
Anton
Anton5mo ago
no, the app just doesn't start or it starts and hangs immediately then it randomly works after a restart
hutoanhill
hutoanhillOP5mo ago
yep same issue
Anton
Anton5mo ago
I think it might be deadlocking on .Result for tasks. I had it in a few places in the initialization code. Seems to work fine after I changed it to use async throughout
hutoanhill
hutoanhillOP5mo ago
just happened to me again:
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
Executed DbCommand (11ms) [Parameters=[@__normalizedName_0='?' (Size = 9)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."ConcurrencyStamp", "a"."Name", "a"."NormalizedName"
FROM "AspNetRoles" AS "a"
WHERE "a"."NormalizedName" = @__normalizedName_0
LIMIT 1
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5154
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Path-To-My-Project
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
Executed DbCommand (11ms) [Parameters=[@__normalizedName_0='?' (Size = 9)], CommandType='Text', CommandTimeout='30']
SELECT "a"."Id", "a"."ConcurrencyStamp", "a"."Name", "a"."NormalizedName"
FROM "AspNetRoles" AS "a"
WHERE "a"."NormalizedName" = @__normalizedName_0
LIMIT 1
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5154
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Path-To-My-Project
fixed itself as soon as i reloaded the page happened again, this time reloading didnt fix it console was empty
Anton
Anton5mo ago
are you creating the db manually? can you show me the code? or send the link to the repo
hutoanhill
hutoanhillOP5mo ago
can link to a repo, nda but i am creating my own database, SQLite
Want results from more Discord servers?
Add your server