How to make asp net website and asp net core website work on a same server

Introduction

ASP.NET is a popular programming language used for developing web applications. One common question that arises is how to make an ASP.NET website and an ASP.NET Core website work on the same server. In this article, we will explore different to achieve this.

Option 1: Running on Separate Ports

One way to make both ASP.NET and ASP.NET Core websites work on the same server is by running them on separate ports. This approach allows each website to have its own unique port , ensuring that they do not with each other.

To implement this, you can your ASP.NET website to run on a specific port, let's say 5000, and your ASP.NET Core website to run on a different port, such as 5001. This can be done by the files of each website.


// ASP.NET website configuration

  
    
    
  
  
    
      
    
  


// ASP.NET Core website configuration

  
    
      
    
  

By running the websites on separate ports, you can access each website using the respective port number in the URL. For example, you can access the ASP.NET website at http://localhost:5000 and the ASP.NET Core website at http://localhost:5001.

Option 2: Using

Another approach to make both ASP.NET and ASP.NET Core websites work on the same server is by using subdomains. This allows you to differentiate between the two websites based on their .

To implement this, you can configure your DNS settings to point different subdomains to the same server IP address. For example, you can configure aspnet.example.com to point to your ASP.NET website and aspnetcore.example.com to point to your ASP.NET Core website.

Once the DNS settings are configured, you need to update the website bindings in the server configuration to handle the subdomains. This can be done by modifying the configuration files of each website.


// ASP.NET website configuration

  
    
    
  
  
    
      
    
  


// ASP.NET Core website configuration

  
    
      
    
  

With this configuration, you can access the ASP.NET website using http://aspnet.example.com and the ASP.NET Core website using http://aspnetcore.example.com.

Conclusion

In this article, we explored two different approaches to make an ASP.NET website and an ASP.NET Core website work on the same server. By running them on separate ports or using subdomains, you can that both websites coexist without conflicts. the approach that best suits your requirements and configuration preferences.

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents