Azure Deploy Build fail "can't find files with extension .dll

hpbcrowe 31 Reputation points
2022-07-12T03:34:51.613+00:00

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:

219666-image.png

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, Identitiy, Repository, 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 data base 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?

Microsoft Identity Manager
Microsoft Identity Manager
A family of Microsoft products that manage a user's digital identity using identity synchronization, certificate management, and user provisioning.
610 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,157 questions
{count} votes

Accepted answer
  1. JasonPan - MSFT 4,201 Reputation points Microsoft Vendor
    2022-07-12T10:16:38.87+00:00

    Hi @hpbcrowe

    1. Could you tell me which version of visual studio you use ?
    2. Please try to use dotnet cli tools to build and publish this project. If there is an error message when using dotnet cli to publish, please update the error message in the post. Next Action

    You can try to upgrade your visual studio to the latest version. (related issue)


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards
    Jason

    1 person found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Bruno Lucas 4,411 Reputation points MVP
    2022-07-12T10:17:50.39+00:00

    Hi @hpbcrowe ,

    Is this a brand new project? Could be you upgraded/changed the target Framework or added a NuGet that is not compatible with your target framework.
    This could be many problems but most like a NuGet vs target framework incompatibility

    Here some suggestions but would try nuget restore first:
    https://ninocrudele.com/error-cs0006-metadata-file-dll-could-not-be-found.
    219853-image.png

    and

    https://social.msdn.microsoft.com/Forums/en-US/ac9ca792-cc8d-49a4-9e53-6d5dfcc1347c/error-cs0006-metadata-file-could-not-be-found?forum=csharpgeneral

    1 person found this answer helpful.

  2. VenkateshDodda-MSFT 18,191 Reputation points Microsoft Employee
    2022-07-12T09:21:07.857+00:00

    @hpbcrowe Thanks for reaching out. Could you please help us whether are you trying to deploy your app to Azure VM or App service?

    Based on the above shared description I understood that you are able to build your project successfully in local. if you're provisioning the app to Azure App Service, kindly try the following steps to isolate the issue.

    • Try publishing the project to your local machine (to a folder) from the visual studio by following these documentation steps here.
    • Once the project is exported to a folder (in local machine) you can login to kudu console(https://<appname>. scm.azurewebsites.net) drag drop the published folder under this path (\home\site\wwwrooot) or you can login to you azure account (connect to your subscription) run the publish-azwebapp cmdlet to deploy published code from local to azure.

    Note: currently Publish-azwebapp PowerShell cmdlet supports to deploy ZIP.JAR or WAR file only.


  3. Bruce (SqlWork.com) 55,601 Reputation points
    2022-08-16T21:24:14.483+00:00

    it looks like your projects have a dependency on CrownQuestModels.dll and there is no project reference to it (so its not built during publish). you probably only a copy in the debug folders.

    if it is your code, add a project reference to it in each of the projects that require it.

    0 comments No comments