# Using ASP.Net Core in Phoesion Glow

---

**Phoesion Glow** is a microservice development framework that offers a complete solution for creating, deploying, and managing your microservices. While **Phoesion Glow** offers a glow-native SDK for writing services, many times we need to use ASP.Net specific features or add a service that is already written in ASP.Net.

In this article, we will focus on creating Glow microservices using the ASP.Net framework.

# Prerequisites / Preparation

For developing **Phoesion Glow** services we need a **Windows machine with Visual Studio 2019/2022** and [**Phoesion Glow Blaze for Windows**](xref:Downloads_Blaze.md) **installed**

# Creating a new service

#### 1\. Create a new Solution

Create a new solution using **Visual Studio** with a **Firefly ASP.NET Core Service Project** project.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678710217354/0ffe4c5d-f1ed-4b1b-9194-a2957254cb2f.png align="center")

> \[NOTE\]  
> If you can't find the **Firefly ASP.NET Core Service Project** template, make sure you have **Phoesion Glow Templates** visual studio extension installed. If not you can [get it from the Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Phoesion.phoesion-glow-vstemplates-vs2022)

#### 2\. Configure new Project

Name your new project and solution :

```bash
Project name : Foompany.Services.MyAspService
Location : <Set your location>
Solution name : Foompany.Services
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678710246071/194ccfc6-4314-4e20-a9f9-8867b0ee73ed.png align="center")

# The `AspFireflyService` class

Notice that your ServiceMain class now derives from `AspFireflyService` instead of the basic `FireflyService`. The `AspFireflyService` class provides the necessary `IServer` implementations that will hook into the **ASP.Net** framework and host the **ASP.Net** stack on top of **Phoesion Glow**. Think of it like a replacement of **Kestrel**, that instead of handling requests from sockets, it handles request from the **Phoesion Glow** framework.

# Test your services

To test that your services are up and running open a browser and go to one of the following :

* [http://localhost/**MyCompany.Services.MyAspService**/Test/Action1](http://localhost/MyCompany.Services.MyService2/Test/Action1)
    
* [http://localhost:16000/**MyCompany.Services.MyAspService**/Test/Action1](http://localhost:16000/MyCompany.Services.MyService2/Test/Action1)
    

# Changing the Service name *(base path)*

As a part of the **Phoesion Glow** project, your microservice **MUST** have a service name so the **API Gateway** system can route the request to the proper service. Like native **Firefly Services** this can be specified using the `[ServiceName("XXX")]` attribute on the `ServiceMain.cs` class. Change this to your desired name, for example just *MyAspService* (without the full assembly namespace that was added by the templates)

Run the project again and test using the following :

* [http://localhost/**MyAspService**/Test/Action1](http://localhost/MyAspService/Test/Action1)
    
* [http://localhost:16000/**MyAspService**/Test/Action1](http://localhost:16000/MySMyAspServiceervice2/Test/Action1)
    

# Summary

In this article, we demonstrated how easy it is to create a new **ASP.NET** microservice that can be deployed/hosted in our **Phoesion Glow** setup. We can now take full advantage of **Phoesion Glow** including the out-of-the-box Mediator, API Gateway, Service-Bus and Deployment/Managing/Monitoring capabilities.

For more information, you can dive into the [documentation](https://glow-docs.phoesion.com/) and [sample repo](https://github.com/Phoesion/Glow-Samples).
