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