'FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer, Version=5.0.0.0 on IIS

I'm working on a microservices project based on .net 5 and recently add API versioning to the gateway endpoint (using Microsoft.AspNetCore.Mvc.Versioning and Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer). API Versioning is working on my local machine but after deploying my project on IIS, I ran into the following error:

FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

FileNotFoundException

Let me know if you have the solution



Solution 1:[1]

You should add Microsoft.AspNetCore.Mvc.Versioning and Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer on Web.Medario.HttpAggregator.deps.json file existing in publish output files.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sina Riani