I've recently been trying to migrate an existing .NET Core 2.2 WEB API project to .NET Core 3.1 with the aim of first migrating from .NET Core 2.2 to 3.0 then to 3.1.
This solution contains contains several .NET Core 2.2 class libraries and a .NET Core 2.2 Web Api project with their corresponding test projects.
I am currently facing an issue that I am not able to find the solution to yet and hoping someone here can enlighten or guide to the solution.
So to the point, I've been going through the official documentation on Migrating from ASP.NET Core 2.2 to 3.0 and managed to make all the changes necessary and have the solution successfully rebuild but for some reason I keep getting the below exception when I run web api test project.
System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types.
Could not load type 'Microsoft.AspNetCore.Razor.Language.RazorTemplateEngine' from assembly 'Microsoft.AspNetCore.Razor.Language, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
Here is the api project package references:
and its corresponding test project references:
I am thinking it may be something to do with packages either in the above screenshots or the class libraries that the web api project depends on ? or missing something?
Now I've researched and looked into this exception thoroughly from Github, SO and other sources for hours in the hope of getting to the solution but to no avail.
If anyone can shed some light on this that would be great. Let me know in comments if you need me to provide anymore info or if you have any questions.
Thanks in advance.

