0

I have built a .NET API and I am trying to publish it. It builds fine and I can run it and access it locally without any problems. But when I try to publish it to Azure it is telling me that the build fails. These are the errors I am getting from the output:

enter image description here

The four errors have to do with four files that end with the extension .dll when I follow the path I can see that the file exists but for some reason, I get an error that they can't be found. Another thing I have noticed is that all four files producing the errors, Model, Identity, Repository, and Services all would have something to do with Microsoft Identity. Could that be it? I know another box in the publish screen asked me to enter the key-value pairs for my Azure database to connect to it. I have my JWT token key in my app settings JSON, do I need to enter those as dependencies in Azure? If so how do I do that?

Ben Crowe
  • 31
  • 1
  • 1
  • 7
  • I have tried cleaning the solution and rebuilding it but that didn't work. – Ben Crowe Jul 12 '22 at 04:18
  • 1
    hey @Ben Crowe by any chance have you gone through this https://ninocrudele.com/error-cs0006-metadata-file-dll-could-not-be-found – SaiSakethGuduru Jul 12 '22 at 05:12
  • 1
    Also have you tried selecting the project dependencies manually by clicking the project in Solution explorer if not try that as well – SaiSakethGuduru Jul 12 '22 at 05:13
  • 1
    let me know if the above solution works once you try it out – SaiSakethGuduru Jul 12 '22 at 05:38
  • Thank you for your help, I am a newbie and haven't used Visual Studio a lot. I downloaded the target framework migrator from https://ninocrudele.com/error-cs0006-metadata-file-dll-could-not-be-found . I dind't understand what it wanted me to do with the nuget package manager. All of the projects had the same build configuration. I don't understand how to: Unload all the project from the solution and start loading each project starting from the base library. Every time you reload one then rebuild the solution. – Ben Crowe Jul 12 '22 at 05:59
  • Are there any blogs or tutorials that show how to do that? – Ben Crowe Jul 12 '22 at 05:59
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/246363/discussion-between-saisakethguduru-mt-and-ben-crowe). – SaiSakethGuduru Jul 12 '22 at 06:27

1 Answers1

0

The problem was that I was using an older version of Visual Studio. I updated VS 2019 to the current version, and it published the API to Azure. The API works great. Thank you for your help.

Ben Crowe
  • 31
  • 1
  • 1
  • 7