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

0

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.

asp.net
asp.net-core
asked on Stack Overflow Dec 24, 2019 by code_explorer

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0