Skip to main content
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 Red Hat 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

    • Red Hat OpenShift AI
    • 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.

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

    • 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.

ConsoleDocsSupport Search
New For you

Resources to explore

Check out popular resources, tools, and information from Red Hat. We'll recommend more as you browse.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

Developing .NET Core 2.0 Web Applications on OpenShift

<p>&nbsp;</p> <quillbot-extension-portal></quillbot-extension-portal>

November 22, 2017
Roland Grunberg
Related topics:
.NETDeveloper toolsKubernetes
Related products:
Developer ToolsetRed Hat OpenShift Container Platform

    Today we're going to create a .NET Core 2.0 Web Application using the JBoss Developer Studio and the aCute plugin (C# application development). We'll deploy our application onto an OpenShift instance and continue to modify it while viewing the changes almost instantly. Although the initial setup will be quite involved, it will only need to be done once.

     

    You might imagine that the normal workflow for this would be:
    1. Make local changes.
    2. Commit + push them to version control.
    3. Either re-trigger a build manually or ensure web-hooks are set up so that OpenShift detects the new changes.

    In these cases, the image containing our build/runtime and project sources must be rebuilt and started on every single change. Not only does this take a while, but also in a development environment, who wants to be committing and pushing every tiny change they make just to see what it looks like? Luckily, there's an easier way that better reflects this "development" workflow.

    We'll start by getting our prerequisites. We will download JBDS from https://developers.redhat.com/products/devstudio/download/ and the .NET Core SDK from https://dotnet.microsoft.com/en-us/download.

    Once those are installed, you'll also need to install the 'aCute' plugin from the Eclipse Marketplace, https://marketplace.eclipse.org/content/acute-c-edition-eclipse-ide-experimental . It's always possible to install things using software sites, but many will find it easier to drag and drop the 'Install' button from the marketplace into the Eclipse IDE workbench.

    If we do end up using a software site to install the content, we'll want to install the 'ACute - C# edition in Eclipse IDE (Experimental)'. Once that's complete, and after a restart, we'll be ready to create our first project.


     
    We're going to create a very simple .NET Core 2.0 Web Application project that we'll push to our GitHub repository so that it can be referenced when deploying our application on OpenShift.
     
    In JBoss Developer Studio, click on File -> New -> Other. Expand the '.Net Core' category from the selection wizard, and select '.NET Core Project'. Now Click 'Next'.
     
     
     
     
    We will be creating the project in our workspace so we'll leave the location option as is. Once the project templates load, select the 'ASP .NET Core Web App [C#]' template and click 'Finish'.
     
    Note: If there are no templates from which to select, it is likely that the .NET Core 2.0 SDK was not installed correctly.
     
     
     
     
    Next, we need to push our new project to a publicly accessible Git repository. In our case, we're using GitHub, but any publicly available location (accessible over https) will do.
     
    Right-click on the project, and go to 'Team' -> 'Share Project...'. Select 'Git' and click 'Next'. Select the option to 'Use or create repository in parent folder of the project' and then click the 'Create Repository' button. When the process is completed, click 'Finish'.
     
     
     
     
    Now let's add the project files to version control by right-clicking our project, going to 'Team' -> 'Commit'. Make sure to stage all files but the contents of the 'obj' folder, provide a commit message and then click 'Commit and Push'.
     
     
     
     
    A new dialog should now appear asking us to specify the destination git repository. We'll use 'git@github.com:rgrunber/dotnet-demo.git' in the URI and that should auto-complete the remaining necessary fields.
     
     
     
     
    Click Next, and once again as we will be using default settings. Finally, click 'Finish'. We have successfully pushed to our newly created repository. Now we can finally go ahead and deploy the application on OpenShift.
     
    First, we need to connect to our OpenShift instance. I'm using one from OpenShift Online, and we'll connect to it by clicking on the 'New Connection Wizard...' link in the OpenShift Explorer view.
     
    Now we fill in the relevant connection information for our OpenShift instance.
     
     
     
     
    We'll have to create a project if none exist, or if we want to keep this work separated from other existing projects.
     
     
     
     
    From the OpenShift Explorer view, right-click 'dotnet-demo', and go to New -> Application... in the context menu. This should bring up the New OpenShift Application wizard.
     
    Note: It may be necessary to import the JSON image stream template for dotnetcore-2.0 images from https://github.com/redhat-developer/s2i-dotnetcore/blob/master/dotnet_imagestreams.json if none are available from the Server application source list.
     
    Here we'll just click the 'Browse...' button, and select our project. From the Server application source list, we'll select 'dotnet:2.0' and click Next. Make sure that the 'dotnet:2.0' image selected exists in the context of the 'dotnet-demo' project, and not just the default 'openshift' context. This is to ensure we're using the newer image.
     
    For the configuration, we'll name our project 'dotnet-demo', using https://github.com/rgrunber/dotnet-demo.git as the git repository url, 'master' for the branch to reference, and '/' as the context directory. We'll also add an environment variable called 'DEV_MODE' and set its value to 'true'.
     
     
     
     
    Click 'Finish', and we should see the necessary image stream, service, build config, deployment config and routes being created. Our application is being built and deployed.
     
     
     
     
    The final step we need to perform involves, right clicking on our newly created dotnet-demo service from under our project, in the OpenShift Explorer view, and selecting the 'Server Adapter...' option from the context menu. From here, click 'Finish', confirming that the 'dotnet-demo' service is selected. Now we're finally ready to make changes to our application.
     
    First, let's view what our application actually looks like. In the OpenShift Explorer view, right-click the 'dotnet-demo' service from within our project and select Show In -> Browser. Click the 'About' link from the top to see what that page looks like.
     
     
     
     
    Now let's try modifying this page's contents. Open up 'About.cshtml.cs' from our local copy of the project and change the message string. Now save the changes, then go back to our web browser and simply refresh the about page. It's that easy.

    The Red Hat OpenShift Container Platform is available for download.

    Last updated: November 9, 2023

    Recent Posts

    • Draining 10K VMs with Dirty Memory at 100-Node Scale

    • Configure Red Hat OpenShift Lightspeed autonomous agents

    • High Scale Performance Testing of OpenShift Virtualization : An Introduction

    • Automate Lightwell updates with Mend Renovate

    • Configure HikariCP for Spring Boot on Red Hat OpenShift 4

    Red Hat Developers logo

    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
    Ask AI