C
C#10mo ago
S-IERRA

❔ Problem setting up ASP.NET on Linux

Hi, I'm trying to setup ASP on linux but I'm getting erros like this https://cdn.discordapp.com/attachments/679791684548296735/1146446137662914590/image.png
24 Replies
S-IERRA
S-IERRA10mo ago
System.TypeInitializationException: The type initializer for 'Microsoft.DotNet.Cli.Parser' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Microsoft.DotNet.Cli.AddCommandParser' threw an exception.
---> System.IO.FileNotFoundException: Unable to find the specified file.
at Interop.Sys.GetCwdHelper(Byte* ptr, Int32 bufferSize)
at Interop.Sys.GetCwd()
at Microsoft.DotNet.Cli.CommonOptions.DefaultToCurrentDirectory[T](Argument`1 arg)
at Microsoft.DotNet.Cli.AddCommandParser..cctor()
--- End of inner exception stack trace ---
at Microsoft.DotNet.Cli.Parser..cctor()
--- End of inner exception stack trace ---
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
System.TypeInitializationException: The type initializer for 'Microsoft.DotNet.Cli.Parser' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Microsoft.DotNet.Cli.AddCommandParser' threw an exception.
---> System.IO.FileNotFoundException: Unable to find the specified file.
at Interop.Sys.GetCwdHelper(Byte* ptr, Int32 bufferSize)
at Interop.Sys.GetCwd()
at Microsoft.DotNet.Cli.CommonOptions.DefaultToCurrentDirectory[T](Argument`1 arg)
at Microsoft.DotNet.Cli.AddCommandParser..cctor()
--- End of inner exception stack trace ---
at Microsoft.DotNet.Cli.Parser..cctor()
--- End of inner exception stack trace ---
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
`
Pobiega
Pobiega10mo ago
Does your dotnet cli work with other commands?
S-IERRA
S-IERRA10mo ago
any test command I could run?
Pobiega
Pobiega10mo ago
dotnet info dotnet build
S-IERRA
S-IERRA10mo ago
nvm so we fixed that but still, we have an issue now where all endpoints end up in 404
Pobiega
Pobiega10mo ago
Mhm. Are you sure you are hitting the .NET server at all?
S-IERRA
S-IERRA10mo ago
S-IERRA
S-IERRA10mo ago
mmm
Pobiega
Pobiega10mo ago
I know what a 404 is.
S-IERRA
S-IERRA10mo ago
yes it is its showing up on the cli
S-IERRA
S-IERRA10mo ago
Pobiega
Pobiega10mo ago
okay
S-IERRA
S-IERRA10mo ago
could be an issue with the nginx config
Pobiega
Pobiega10mo ago
well it looks like nginx forwarded it correctly to me are you using minimal api or controllers?
S-IERRA
S-IERRA10mo ago
controllers
Pobiega
Pobiega10mo ago
okay, show me the controller you are trying to hit here
S-IERRA
S-IERRA10mo ago
i think its because its failing to connect to db on start up
Pobiega
Pobiega10mo ago
that shouldnt cause it to 404 it should either not start at all, or throw errors that would result in 500s
S-IERRA
S-IERRA10mo ago
ye it doesnt do that
S-IERRA
S-IERRA10mo ago
this is the controller
Pobiega
Pobiega10mo ago
okay, I see its listening on api/listings but your request was for backend/api/listings is nginx routing the backend part and stripping it? actually, its clearly not since you are seeing backend/api/listings in your kestrel logs thats your issue, your urls dont match up
S-IERRA
S-IERRA10mo ago
S-IERRA
S-IERRA10mo ago
yeah they didnt ty
Accord
Accord10mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.