In this article, we will discuss about an error when we try to run an ASP.NET Core project copied from one machine to another machine.
I have created an ASP.NET Core project using the project template in Visual Studio 2015. It was working properly on my laptop. Then i copied that same solution from my laptop to desktop machine and tried to run the project. When i tried to run the project, i was getting 500 Internal Server Error as shown below (F: 1). But the same solution was working properly on my laptop.
When i copied the solution folder from my laptop to desktop machine, a hidden folder .vs was also got copied. When i looked at the error message closely, i found that it was displaying the config file location as the location of that file on my laptop as shown below (F: 2).
There are two solutions to fix this issue.
First solution is very easy. For second solution first we need to close Visual Studio 2015. To change the physical path for the solution in applicationhost.config file, open up the applicationhost.config file located under .vs/config folder of copied solution and search for term “sites”. It is a XML file.
Under sites node locate the site node where physical path for the solution is specified and binding information contains the same port number as your application is trying to run on as shown below.
Then I just change the physical path value to the actual physcial path of the solution on my desktop machine. Then everything started to work.
First solution is also similar to second solution because when we reopen the project in Visual Studio 2015, Visual Studio will change the solution path in applicationhost.config file according to the new physical path of the solution on new machine. But if it doesn’t work then, we need to follow the second solution and change that path manually.
In this article, we talked about how to resolve the 500 Internal Server Error issue when trying to run an ASP.NET Core project copied from one machine to another machine. I hope you enjoyed reading the article.
Happy Coding and Wish You A Happy New Year!
Hi there! Someone in my Myspace group shared this website with us so I came to check it out. I'm definitely enjoying the information. I'm bookmarking and will be tweeting this to my followers! Terrific blog and fantastic design and style.
Thank you for the feedback Rubin