How to Get Started with Microsoft’s eShopOnWeb ASP.NET Core Reference Application

Oct 15, 2024 | Programming

If you’re delving into the world of .NET development, the Microsoft eShopOnWeb ASP.NET Core reference application serves as a brilliant starting point. It’s designed to demonstrate a traditional monolithic application architecture. Follow this guide to set it up, and enjoy the process of creating your application!

Overview of eShopOnWeb

The eShopOnWeb application is tailored for developers starting with ASP.NET Core. It showcases fundamental principles and patterns used in modern web applications. While it does not cover all features necessary for a full-fledged eCommerce application, it provides an excellent foundation for learning.

Getting Started

Before you begin, let’s ensure you have everything in place. If you are new to .NET development, take a moment to read the Getting Started for Beginners guide for a more comprehensive introduction.

Step 1: Preparation

  • Check the FAQ section for any doubts.
  • Make sure you have installed the Azure Developer CLI to provision and deploy your application.

Step 2: Running the Application

You can run the application using two main methods: via Azure or locally.

Running with Azure CLI

azd auth login
azd init -t dotnet-architecture/eShopOnWeb
azd up

This will provision the resources and deploy the application. Wait for the deployment to complete, and then you can access your application through the provided web endpoint.

Running Locally

For local runs, start with the following commands:

dotnet run --launch-profile Web

Remember, the admin section requires running the Public API as well. You’ll be able to access your application at https://localhost:5001.

Setting Up SQL Server

To configure your sample using SQL Server, follow these steps:

  1. Ensure the connection strings in appsettings.json point to your local SQL Server.
  2. Run the Entity Framework Core commands to set up your databases.
  3. dotnet ef database update -c catalogcontext -p ..\Infrastructure\Infrastructure.csproj -s Web.csproj

Running in a Docker Container

To simplify deployments, you can run your application using Docker. This approach encapsulates your application within a container which is portable and consistent across environments:

docker-compose build
docker-compose up

Once running, access your application at http://localhost:5106 for the Web project.

Troubleshooting

Facing issues while running the application? Here are some troubleshooting tips:

  • If you’re having trouble logging in, ensure you’re using a new incognito window, as cached data may cause conflicts.
  • Be sure that your database connection string is correct and reflects the local SQL Server settings.
  • In the case of file locking errors, manually stopping the application before rebuilding is advisable.
  • If problems persist, consider reviewing the Azure deployment logs for any overlooked steps.

Also, for more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox