locked
FileLoadException: During runtime for an assembly "package referenced" (local nuget) from asp.net core csproj RRS feed

  • Question

  • User1176738122 posted

    Here's the situation what I am facing with:

    Asp.net core .cs web host project has a reference to package "ABC", version 1.0.1.  If I set the package source to restore ABC directly from the feed and build, run the application it all works fine. Let's say, If I have the code base of ABC (.net standard assembly) and I want to make some changes and test/debug it locally, this is what I usually does:

    • I make changes in ABC project, create a local nuget package (.nupkg and .snupkg) with a version greater than or equal to 1.0.1
    • Set the package source in asp.net core project to restore from the local folder where I have the nuget pkg (or MS VS Offline Pkgs folder) and build, run the project.

    Though it restores,builds fine,  I am getting a runtime error from the host:

    FileLoadException: Could not load file or assembly 'ABC, Version=1.0.1, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    If I follow the same steps and tried to restore/debug local nuget pkg for a .net core console app, it works perfectly fine. This behaviour is happening only in asp.net core web app.

    Appreciate your valuable inputs. Thank you.

    Tuesday, December 24, 2019 12:20 AM

All replies

  • User-1492487179 posted

    Hi,

    Could you please clarify what “ABC” are you using. Do you get the package form browse or create the package by your self.

    Please provide the full package name  and version in your test if you get it form browse. could you please provdie the more deatil about the package about the "ABC" if you create it by your self. You can provide the package and I can following your steps to reproduce the error intrenal. Would you please also tell me your visual studio version?

    Appreciate your communication, Thank you

    Tuesday, January 7, 2020 6:10 AM
  • User-474980206 posted

    if you update the version number of the nuget package, you need to update the package reference in the project file to the new version (.net core does not support runtime rebinding).

    Tuesday, January 7, 2020 5:36 PM
  • User-1492487179 posted

    Hi,

    I can't reproduce your problem internal. Please try the things in following link which provide several resolves.

    https://social.technet.microsoft.com/wiki/contents/articles/5017.troubleshooting-the-located-assembly-s-manifest-definition-does-not-match-the-assembly-reference.aspx

    Monday, February 24, 2020 2:37 AM
  • User-1492487179 posted

    Hi

    Thanks you for your patient. Does the steps in the link help you to solve your problems.

    Monday, March 2, 2020 6:22 AM