Last post Apr 23, 2017 08:34 PM by bruce (sqlwork.com)
Apr 22, 2017 03:35 AM|siegfried_heintze|LINK
I have a windows 10 notebook computer and I would like to try out running the VS Code editor to develop a small ASP.NET/MVC Web site that uses Entity Framework with PostgresSQL on Linux.
What do you recommend? I could
(1) Create an Ubuntu VM and use the Hyper-V GUI to run a session on the VM.
(2) What about Docker? I'm new to docker I just installed Docker on my Windows 10 and I can get a bash prompt. It works! Yahoo! Is it good for anything serious? Can I develop an ASP.NET core web site using docker? Would I want to? I'm not sure how to share
files with this bash prompt. Can I install .NET core and postgressql and g++ on it?
(3) What about inexpensive third party hosting. Wow! I saw an ad for $1/month on this site. That is pretty cheap! Last fall I ran the HelloWorld program in C# on Core on Nitrous.IO for free and it looks like they went out of business! Shucks.... (I guess
they did not charge enough) Perhaps I could use Cygwin X on windows and Xhost to run VSCode on a third party Linux VM somewhere? Any recommendations?
Without buying new hardware, those are the only options I can think of. (I forgot about creating a Linux partition and creating a dual Linux/windows boot system -- but that is too old fashioned for me) Are there any other options?
Let me know what you have tried and what you recommend for running VS Code and postgressql and a little demo ASP.NET Core Web site.
Apr 22, 2017 03:44 PM|bruce (sqlwork.com)|LINK
the advantage of asp.net core is you can develop on one platform and deploy to another. Just be sure you pick core and not framework 4.x and you can build and test on your windows 10 machine.
this will get your asp.net code running, but you will still need to define and setup the linux environment to run your code (reverse proxy, etc). here a linux vm would be hardly for this testing.
you need to be a little careful with docker on windows. you want to be sure you are creating linux containers, not windows containers. to run a linux container, a linux vm must be installed (the docker install does this).
note: docker is a deployment environment, not a development environment. there is a progress docker image.
whether you use docker, or linux will depend on your chosen host.
then use the windows bash to run these tools.
note2: I'm the opposite of your. I do all my development on a Mac and deploy to windows.
Apr 22, 2017 10:21 PM|siegfried_heintze|LINK
Please elaborate on docker on windows: As I understand it, windows containers are only available on Windows Server and I'm just running windows 10 pro. When I downloaded and installed docker for windows, this created a Linux VM. I can see it on the HyperV
GUI. And the second exercise to prove it is installed correctly is to get a bash prompt. So can I safely assume I'm using Linux containers?
Please elaborate on defining the Linux environment such as reverse proxy. Why would I have a proxy? What else do I have to set up?
I was very surprised to find (after I made my original posting) that in addition to mac and windows and Linux, docker is a option as a deployment target for the dotnet SDK! Strange! OK, I guess you are not recommending this option.
Given that I'm running Cygwin on my windows 10, can anyone point me to the instructions for using the Linux/Cygwin xhost and display features for setting up an Xwindows session on my Linux/Ubuntu VM (or docker image on which I have installed dotnet sdk)?
I would like to easily run VSCode on both Linux and windows and transfer files to/from my VM. Do you recommend setting up SAMBA on the Linux VM?
Now lets suppose my little ASP.NET/EF/PostgresSQL demo works great and I want to show it off to my friends by putting it on a third party hosting service. I assume there is a feature in the dotnet cli that makes this easy?
Also, what about entity frameworks core with postgressql? Do I install postgressql separately or is this done by dotnet cli?
Apr 23, 2017 08:34 PM|bruce (sqlwork.com)|LINK
yes, you are using docker containers. asp.net core should not be exposed to the internet, it should be behind IIS on windows or a proxy on linux like ngix or apache. A future release will be hardened enough to be exposed.
while you can use a docker container for dev via shell commands, or X-11 for a GUI (will require including a x-11 docker container), its not the same a devbox. docker is well worth learning, as its the future for web deployments, but you will require a host
that supports docker.
I use OS/x and windows (windows a vm on my mac), so can not advise on best linux and windows setup.
.net core has a nuget package to supply EF drivers for PostgresSql (you use the cli to fetch the package). installing a PostgresSql server is a separate issue. if you start using docker, then you can just use a PostgresSql container.
I use sql server and use a docker image on OS/x:
asp.net core has limited deployment features. basically it will build a folder to be copied to hosting server. it can now build a docker image, you just deploy like any docker. also deployment to azure is simple (really easy if source is hosted on GitHub
or TFS online).