MVC Adventures Part 1

I had just started to learn Asp Core MVC last fall, but my new job uses Python and PL/SQL so I haven’t touched MVC since. However, the time has come to start building the middle-tier for my friends in Nepal, so I’m diving back in.

I have to keep this short because it is definitely bedtime. I started a blank MVC project in Visual Studio and *gasp* forgot to check that little checkbox that pulls in the default MVC assemblies. So of course all my references in the Controller were off. Sane people would just scrap the project and start over, but I lack this desirable quality and decided to tough it out. That’s really the only way to learn, especially in systems like Visual Studio where you have training wheels Frankenstein’ed all up in your business. Point-n-click for WebForms just killed me, I just died inside, I had to blank-slate my way through every asp tag attribute before I felt I wasn’t a complete idiot with what I was doing. Anyway, after several headaches, I finally figured out that if I browse the offline packages in NuGet (what an idiotic name…), I could get Microsoft.AspNetCore.MVC installed, my references would resolve, and I could start the page with the debugger. Of course, I’m still missing tons of packages, and don’t know how to specifically get the Tools assembly from Microsoft.AspNetCore.Razor (I’m referencing another project that shows which packages are normally created when you check the checkbox), but hey, it doesn’t die.

And you want to know something fun? Currently, my page is not loading. But that doesn’t stop MVC from loading a page with nothing other than “Hello World!” in text on it. Somewhere deep in that system it is defaulting to that. Which is retarded because that defeats the entire purpose of doing “Hello World”. “Gee, you screwed up, so we’re going to tell it Hello World for you!” But if you couldn’t get it to work, that is failure, that is not “Hello, World!”

Ok, despite my frustrations, THAT IS HOW IT IS DONE!!! You can’t ever hope to really understand Visual Studio until you can bootstrap the defaults yourself. Ye-ah! Anyway, there will be a part 2.

Advertisements