Umbraco -> aspnet core -> microsoft.testplatform.c...
# help-with-umbraco
d
Hey, I try to host my own Umbraco site on Linux and tried a new Umbraco Template for aspnet core and then deploy it with: dotnet publish -c Release Has anyone ever done something like this? I already googled it but couldn't find anything good. Youtube tutorials as this point were also no help to me. When I try to run it with dotnet run it thows an error. If I try donet test --project myproject.dll I get the error from the title I created here. Anyone got some tips or help for me? Kind regards, Daniel
o
Hi Daniel, maybe this can help

https://youtu.be/mkBYgwfOzdc

Also the asp.net core deployment docs
s
> When I try to run it with dotnet run it thows an error. You run the site using
dotnet MyProject.dll
- not with
dotnet run
. The dll there is whatever your website project is called, for example, mine is called
Cultiv.csproj
and the output dll after
dotnet publish -c Release
is
Cultiv.dll
, so I'd start the site with
dotnet Cultiv.dll
. Note that you'll get 0 output on the CLI after that, the site is running on port 5000 by default, so
wget https://localhost:5000
is a way to test it works. Note: I've not actually properly hosted a site on Linux before, so I don't quite know how to proceed from there. The above video seems a bit convoluted, but is probably a good way to do it, but I have not attempted to learn nginx yet 😅 My main, biggest, worry would be: okay, you've set up a certificate with Let's encrypt, cool, that will work for 6 months.. and then what! Cert will expire, how to renew it, can that be automated, can I get a heads up if that fails, etc.
d
@oalberto Exactly this video I was following. With exception I did run donet run, because I was told so in my other thread: https://discord.com/channels/869656431308189746/1131893857299222529 @Sebastiaan Thank you, this is something I didn't knew. I'll try to fix the issue now and comment so far if it worked or not... Wouldn't you think it would be handy to have install instructions for umbraco documentation, so that other "noobs" are in the spot to do the same thing? In my opinion it would help a lot of people I think ... 🙂
s
It's extremely difficult to document "how to host Umbraco" as there is so many different ways and opinions. We usually point to Microsoft documentation for how to deploy to servers etc. To be honest, we have very little hands-on experience with Linux at HQ so we don't really know what's best either. Most things we do are Azure App service which just sets all this up for us so we don't need to think about how to manage servers. I'd love to see good Umbraco-specific tutorials made by community members though!
d
@Sebastiaan I thought about creating a simple tutorial for people who want try to host on Linux. The question is would it make sense to create it on umbraco documentation? A few steps on how to install this and that, how to run the dll and what to copy over and what not .... If it wouldn't make it into the documentation I could also create a short youtube video I guess ... Whats the way to go here? documentation or youtube?
s
Youtube + a blog post would be great (https://dev.to is awesome to create blog posts easily) - text is great for Googling and videos are great for some people to get a feel for how everything fits together.
d
@Sebastiaan hmm never used dev.to but I think i really could do both. If I find the time to cut the video and such... But I guess I want to give something back to such a great project which is in my opinion the best on the market. (umbracoCMS) I let you people know until when I got it finished. Should I post the dev.to link with my article somewhere? So that people will find it from the umbraco scene, or let them simply google it? 🙂
s
That's awesome, so happy for people who love to give back! Once you have a dev.to account we can add it to the Community Blogs (https://github.com/umbraco/OurUmbraco/blob/main/OurUmbraco.Site/config/CommunityBlogs.json) list and then it will automatically publish new articles to #882981290662580264 and an RSS feed (https://our.umbraco.com/communityblogsrss). And of course, feel free to throw it on Twitter (if you're still on there), Mastodon, etc.!
I'd be curious to learn more about your linux adventures in follow up posts as well! Eager to learn for myself as well 🙌
d
That sounds like a plan. I'll give my best to create a simple instruction for people who want to host on linux... 🙂
o
Now I’m curious as well 😅 maybe I will try it. I’ve published .net core on Ubuntu before but without things like certificates, just for demo purposes
@danielhok are you using Linux for SQL database deployment as well?
d
@oalberto at the moment for simplicity I only use sqlite ... erverything works so far but when I try to start the application with dotnet myProject.dll I get path not found ... I developed on macOS and copied files over to a linux vm and with different user and paths ... any hints on how and where to resolve that? The Video postet by you @oalberto shows even a way how to automatically resolve with certbot https encryption. You need nginx installed in a ubuntu machine and also apt-get install dotnet-core-sdk-7.0 nginx -y
o
If you are using nginx, the service is responsible for running the dotnet app “ExecStart=/usr/bin/dotnet /var/netcore/Application.dll” what you are saying is that “dotnet app.DLL” doesn’t work? You’ve confirmed that dotnet can be executed from any location on the OS (included in path) and has access to DLL location?
s
If not on nginx, are you in the correct folder? I did this wrong the other day as well 😅
d
@oalberto for debugging purpose I dind't come so far to adjust the service I simply did cd to the directory and startetd dotnet application.dll ... At the moment I've it the same way as you! Have you created the project on the linux server or did you copy an existent one to Linux? the problem with an existent one is that the path's are not matching... @Sebastiaan Thanks for the tipp, but correct folder it is. It shows me macOS paths and usernames but not the linux ones and they must be somewhere inside the project but at the moment I can't find them where to edit ...
I tried to call the dll from a different folder like this: /root/# dotnet /var/www/project/project.dll and it throws the error with paths, so calling from everywhere should be possible!
o
What is the error with the paths? Can you share it?
d
one second
the danieloberlechner user is my macos one, on the linux machine the user and path should be different If you create a new project on linux the path's are allright as far as I can tell, but copy them from macos -> Linux seems to make problems somewhere
o
Something related with static assets apparently
d
yeah, I think I copied the files from the project via ftp
do I have to build the project on linux or simply can I release it on macos and copy from there all files to linux and simply run?
probably I have to build on linux to fix paths, but on Linux building will get you a tons of errors, see my other thread!
I was indeed in the wrong directory @Sebastiaan Thank you for the tip! I don't know why I do have so many files and folders, but now it is working for the moment. Further debugging is needed! Thank you so much! 🙂
o
It’s not supposed to. I’ve published multiple asp.net core projects developed on windows and macOS on Linux azure web apps without issue
Ahhhhh finally 😅
d
yeah found the issue ... i had multiple exports and didn't look into the inner folders, don't know what kind of mistakes I've all made ... im sorry for taking ur time !! :/
o
No problem 👌
12 Views