I made a test website on my computer. How do you publish it?

Started by
14 comments, last by hplus0603 7 years, 4 months ago

On the fourth page of that tutorial, it tells you that you're working with the database:
https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/adding-model

It does not. The only thing of interest mentioned was something called "Entity Framework Core" which I looked up and found this. Upon reading this it seems to imply Entity framework core can optionally use Microsoft SQL server. https://docs.microsoft.com/en-us/ef/core/providers/sql-server/

Where does it state this? I am not trying to use Microsoft SQL Server and I know this sounds rude but you are being vague.

Advertisement

It does not. The only thing of interest mentioned was something called "Entity Framework Core" which I looked up and found this. Upon reading this it seems to imply Entity framework core can optionally use Microsoft SQL server. https://docs.microsoft.com/en-us/ef/core/providers/sql-server/


I'm thinking of the explanation starting in this section (and continuing to the next page):

Update the database

Open a command prompt and navigate to the project directory (your_path/MvcMovie/src/MvcMovie). You can find the path by selecting the web.config file in Solution Explorer and viewing the Full Path property in the Properties window.

Run the following commands in the command prompt:

Copy
console
dotnet ef migrations add Initial
dotnet ef database update
dotnet ef commands
dotnet (.NET Core) is a cross-platform implementation of .NET. You can read about it here

dotnet ef migrations add Initial Runs the Entity Framework .NET Core CLI migrations command and creates the initial migration. The parameter "Initial" is arbitrary, but customary for the first (initial) database migration. This operation creates the Data/Migrations/_Initial.cs file containing the migration commands to add (or drop) the Movie table to the database

dotnet ef database update Updates the database with the migration we just created


On Windows, "database" means "SQL Server" unless you've done something different in particular to try to make it mean something else (which sometimes works and sometimes doesn't.)
enum Bool { True, False, FileNotFound };

?Looks like I'll need to restart this experiment to go for the cheaper option. At least visual studios 2015 can be used for my c# projects. I'm going to follow this advice now. Is this good advice from a previous thread?

Fire up your text editor, write some HTML, CSS and maybe JavaScript if you are into that sort of thing, and upload the whole collection to some HTTP-accessible location on the web. Or pay somebody like SquareSpace to do most of the heavy lifting for you.

Is there a specific technique or goal you want to accomplish here?

Right, this is the draw-back of Microsoft technologies. They cost money to get started!Linux has managed to become a contender because the up-front cost is zero.(Also, a lot of people feel the ongoing costs are lower, too -- but that's more of a case-by-case thing.)Yes, if you followed the tutorial you initially linked to, then the storage for your movies lives in a SQL Server database. The "express" version may be enough for small sites.The Visual Studio ASP.NET integration is very nice, though; much slicker than most tools for the Linux side which are very text-editor-based.Did you try the "Host in the Cloud" checkbox? I think you can use a free trial Azure account to try that out.

I've personally had nothing but problems deploying asp.net sites. They often need compilation, and once you upload all your dlls you generally have to then ensure the server has all your dependencies dlls and programs installed which often have only graphical installers and must be installed via remote desktop so scripting deployment and maintaining a separate identical dev environment becomes a pain and almost certainly requires you to have administrator access to the server.

I find it much easier to deploy to Linux using php and MySQL as it's a simple matter of uploading the script and importing a db dump which usually then just works. You can usually deploy any dependencies purely in an automated scripted fashion with normal user privileges so the hosting is cheaper as you don't need a complete vps along with associated licensing.

The upshot though of using asp.net and the Microsoft stack and mssql is that you get to use the absolutely fantastic Microsoft SQL management studio which puts the horrid MySQL workbench to shame and squarely in the bin.

Hope this opinion helps...

ASP.net core wasn't a good fit for me. Too costly to start with, out of the norm, and seemingly I don't have the right hardware to do good work, but why let a little failure bring me to a halt. Since this thread is open for now at least I have a few questions.

  1. HTLM or HTLM5. Do I learn both or just HTLM 5?
  2. Could you recommend any good software similar to visual studios for writing my HTLM and CSS code?
  3. Do I need the Linux operating system for web development??
HTML5 is the flavor of HTML that's current. There's nothing about older HTML that won't work, but if you're starting now, you might as well follow all the HTML5 best practices.
The other thing to learn is CSS (which means CSS3 these days.)
Also ECMAScript 5 (also known as "JavaScript 5") is common, and ECMAScript 6 is starting to become standard on all the browser that "matter."
(Only IE11 doesn't do 6)

Now, when it comes to HTML, CSS, and JavaScript, you typically use a number of helper frameworks, because the technologies are kind-of raw on their own.
My personal favorite for a bare website without special bells or whistles is actually to just write raw JavaScript, CSS, and HTML.

For bigger things, I'd suggest TypeScript (which compiles to JavaScript, and has good integration in VS Code,) SASS (which lets you write some nicer syntax than raw CSS) and React (which is a framework that generates HTML5)
However, there are tons of different frameworks out there (anything from Angular to Ember to Backbone to who-knows.)

https://www.typescriptlang.org/docs/handbook/react-&-webpack.html

For back-end, I happen to like raw node.js or PHP for small things, and Haskell / Warp for big things. Your mileage will almost certainly vary here!
I like MySQL and Postgres as SQL databases, and Redis as a cache (but not for persistence!) Please stay away from people who try to tell you MongoDB is great -- it's certainly easy to get started with, but it's like building a sand castle; it won't stand the test of time.
To develop, I recommend getting a copy of VirtualBox and installing some simple Linux on that (Ubuntu or Red Hat most likely.)
If you stick to PHP, HTML, JavaScript, and CSS, using MySQL as your database back-end, you will be able to get very cheap (or even free) web hosts that you can deploy your application to.

Unfortunately, because of the highly complex layers of technology that fetches pictures and text to put on your screen, there are so many layers you'll end up having to learn about, so there's no single "here's everything you know" tutorial.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement