Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

ASPNET MVC Core 1.0

May 17, 2016
Don Schenck
Related topics:
.NET
Related products:
Developer Toolset

    With the advent of .NET Core 1.0, things have changed. Dramatically.

    • For starters, it's open source. This means anyone, including you and I, can submit bug fixes and enhancements to the .NET framework.
    • It will now run on Mac and Linux.
    • You can compile code natively to the platform of your choice.

    And beyond that, it's much more modular. There's the Common Language Runtime (CLR), the CoreFX (where the "System." libraries live), the Command Line Interface (CLI), and other modules. ASPNET is separate from MVC which is separate from Entity Framework. Then, finally, tooling --- things such as Visual Studio --- are at the top. This separation means things change, and improve, more rapidly.

    This also allows for huge increases in performance. It also means things have changed, and how you write code has changed. The new model isn't a big learning curve, but moving legacy code is a "port" and not a "migration".

    Let's examine an ASPNET program in .NET Core 1.0. And let's be honest; if you're writing a web site in ASPNET, you're probably going to be using MVC. Web Forms are not supported in .NET Core, and when was the last time you wrote a static web site or hand crafted HTML "anchor" tags?

    Following are two small classes of note: Startup.cs and Program.cs.

     

    The Startup class is where your pipeline is established, the place where you configure the runtime environment.

    In note 1, you can see that MVC support is added to this web application. This is because, in the new model, this is a console application. That's right; you can launch it from the command line and shut it down with a simple Ctrl-C. MVC is a layer now that you must explicitly add to your application. Get used to this, because this is how things will be from now on --- you add only the bits you need. The downside is more coding (but we'll have generators and templates for that); the upside means leaner, faster and easier-t0-maintain code.

    In note 2, the routing is configured. Where, before, you used RouteConfig.cs, now you put your routing in the Configure method of the startup class. Likewise, any filters would be added here. Same code, different place. Also, the routing allows for some nice defaults --- in this case, the controller and action are defaulted to "Home" and "Index". Right there, easy to see and understand.

    Note 3 is there because this sample application uses SQLite as the database, and this simply makes sure the database exists. This isn't related to MVC per se; I merely wanted to call it out to avoid any confusion.

    Finally, note 4 is where the web hosting is configured and built. The .UseStartup method replaces the old Application_Start function in the Global.ascx.cs file (which is gone now). The .UseContentRoot method is notable; it tells Kestrel --- the web server, built on LibUV and blazingly fast --- where to look for files for this application. This can be configurable, of course, but in production you'll most likely stick with the current directory.

    "Blazingly fast" isn't just hype; Microsoft has quoted numbers of 3.5 million requests per second. That's fast.

    As you can see, most of this code is rather obvious. What's important to note is that you're doing things in code now, instead of in configuration files. Of course, your settings can still be stored in a configuration file, but you're now explicitly writing the code instead of simply relying on the MVC engine to do the work.

    Also, check out the treeview for this particular sample project:

     

    Notice anything missing? Hint: Where's web.config?

    You'll now find the files "appsettings.json", "package.json" and "launchSettings.json" (inside the "Properties" folder) combined with your code to do the work of the old web.config file.

    The "project.json" file is also a really big deal, but this is changing when .NET Core 1.0 Release Candidate 2 ("RC2") becomes available, probably around the same time as this blog post.

    At the time of this writing (May 13), the old .csproj file isn't used. However, Microsoft is bringing it back for RC2 (which will make migrating legacy code much easier), so the role of project.json will change a bit. For now, project.json is most notable because it contains the list of all the packages that are referenced by your project, i.e. which DLL's it will pull down using NuGet.

    If you want to start experimenting with ASPNET Core and MVC, you can download this project from my github repo and hack away. You can also get a zero-cost Red Hat Linux Developer Suite and run this code on Linux. Finally, stay up-to-date regarding .NET on Linux at RedHatLoves.Net.

    All The Best,

    -- Don

    For additional information and articles on .NET Core visit our .NET Core web page for more on this topic.

     

    Last updated: February 6, 2024

    Recent Posts

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    • Fun in the RUN instruction: Why container builds with distroless images can surprise you

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.