R
Railway•10mo ago
thibodr

/bin/bash: line 1: ./out/[projectname].Domain: No such file or directory

I am trying to publish a .NET 7 application to railway and I'm getting the following error: /bin/bash: line 1: ./out/[projectname].Domain: No such file or directory The build succeeds but the error shows up when it's deploying. Thanks in advance for the help! Project ID = 8546a8b7-d650-44fe-bdd9-6ff418e13e1b
25 Replies
Percy
Percy•10mo ago
Project ID: 8546a8b7-d650-44fe-bdd9-6ff418e13e1b
Brody
Brody•10mo ago
@aleks more .net problems 🙂
root
root•10mo ago
Could you send your code? At first glance, I don't know what's going on. First, though: are you using Nixpacks or a Dockerfile?
thibodr
thibodr•10mo ago
As far as I’m aware I’m using Nixpacks. I had to specify in the environment variables to use .net 7 I’m afraid I cannot send you any code because I’m working for a company and I cannot share any code.
root
root•10mo ago
Alright, understood, I'll see if I can figure out what's happening here. Does your app use C# or F#?
thibodr
thibodr•10mo ago
We are using C#
root
root•10mo ago
Would it be possible for you to send the build plan table at the start of the build logs?
thibodr
thibodr•10mo ago
ofcourse, give me a sec this?
root
root•10mo ago
Yep, thanks
thibodr
thibodr•10mo ago
idk why start is './out/...'
thibodr
thibodr•10mo ago
folder structure:
thibodr
thibodr•10mo ago
thibodr
thibodr•10mo ago
src folder looks like this:
thibodr
thibodr•10mo ago
env var
root
root•10mo ago
Hmm, I'm not 100% sure what's going on here @neb :), you wrote the provider, sorry for the ping, but could you help?
thibodr
thibodr•10mo ago
solved the issue by creating my own dockerfile and deploying from railway-cli
root
root•10mo ago
Would it be possible for you to send the dockerfile that fixed it so we can improve the nixpacks provider?
thibodr
thibodr•10mo ago
I will send the dockerfile asap though I'm facing another issue right now..
thibodr
thibodr•10mo ago
thibodr
thibodr•10mo ago
I know I need to expose my app on 0.0.0.0 and use the port but i have no clue how to do this in .net any ideas?
root
root•10mo ago
Try setting the ASPNETCORE_URLS environment variable to http://0.0.0.0:3000 - that's how the Nixpacks provider does it
thibodr
thibodr•10mo ago
@aleks sorry for the ping, but I'm facing an issue with the CORS. This is the error: Access to XMLHttpRequest at '[api]' from origin '[application]' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Everything was working fine until this morning when I published a new version of the api. I've reverted back to the old version but the errors is the same. Also when I change the 3000 with the PORT env var it was working but now it's not so i placed the 3000 instead and now i'm getting CORS error
thibodr
thibodr•10mo ago
I had this http://0.0.0.0:${{PORT}} and it was working fine but now i get
thibodr
thibodr•10mo ago
------------------------------ okay, I have managed to fix the issue I found out that this is doing nothing builder.WebHost.UseUrls($"http://0.0.0.0:{Environment.GetEnvironmentVariable("PORT")}"); had to do this ^^ now it's listening correctly CORS error is also gone
root
root•10mo ago
Ah, alright. Glad your problems are fixed, sorry I couldn't have been of more help