C
C#17mo 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-IERRAOP17mo 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
Pobiega17mo ago
Does your dotnet cli work with other commands?
S-IERRA
S-IERRAOP17mo ago
any test command I could run?
Pobiega
Pobiega17mo ago
dotnet info dotnet build
S-IERRA
S-IERRAOP17mo ago
nvm so we fixed that but still, we have an issue now where all endpoints end up in 404
Pobiega
Pobiega17mo ago
Mhm. Are you sure you are hitting the .NET server at all?
S-IERRA
S-IERRAOP17mo ago
S-IERRA
S-IERRAOP17mo ago
mmm
Pobiega
Pobiega17mo ago
I know what a 404 is.
S-IERRA
S-IERRAOP17mo ago
yes it is its showing up on the cli
S-IERRA
S-IERRAOP17mo ago
Pobiega
Pobiega17mo ago
okay
S-IERRA
S-IERRAOP17mo ago
could be an issue with the nginx config
Pobiega
Pobiega17mo ago
well it looks like nginx forwarded it correctly to me are you using minimal api or controllers?
S-IERRA
S-IERRAOP17mo ago
controllers
Pobiega
Pobiega17mo ago
okay, show me the controller you are trying to hit here
S-IERRA
S-IERRAOP17mo ago
i think its because its failing to connect to db on start up
Pobiega
Pobiega17mo 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-IERRAOP17mo ago
ye it doesnt do that
S-IERRA
S-IERRAOP17mo ago
this is the controller
Pobiega
Pobiega17mo 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-IERRAOP17mo ago
S-IERRA
S-IERRAOP17mo ago
yeah they didnt ty
Accord
Accord17mo 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.

Did you find this page helpful?