I have a windows forms application
WinFormsProj, which references a class library project named
ModelsProj has dependency to
Microsoft.Azure.Cosmos.Table version 184.108.40.206.
At runtime, when
WinFormsProj reaches this code, raises a
FileNotFoundException saying that
could not load or find assemble Microsoft.Azure.Cosmos.Table`:
var entityTypes = typeof(EntityBase).Assembly.GetExportedTypes() .Where(t => t.GetInterface(typeof(IDto).FullName) == null && t.GetInterface(typeof(IEntity).FullName) != null && !t.IsAbstract);
EntityBase is the base type of all of my model entities, and is located in
I can solve the exception by just adding a reference to
However, I expect the program work without doing this! My question is : Why isn't the dll of
Microsoft.Azure.Cosmos.Table getting copied to the output? Isn't the build process supposed to put all the needed dlls in output directory?
I've found here that a common cause is that a project and one if its dependencies, depend on different versions of the same package. That is not my case,
WinFormsProj does not need to reference any version of
fuslogvw.exe to inspect what happens and here is its log:
*** Assembly Binder Log Entry (8/12/2020 @ 10:25:22 AM) *** The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable H:\melkradar-git\melkradar\src\MelkRadar\Mgmt\MelkRadar.Mgmt.Win\bin\Debug\MelkRadar.Mgmt.Win.exe --- A detailed error log follows. === Pre-bind state information === LOG: DisplayName = Microsoft.Azure.Cosmos.Table, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35 (Fully-specified) LOG: Appbase = file:///H:/melkradar-git/melkradar/src/MelkRadar/Mgmt/MelkRadar.Mgmt.Win/bin/Debug/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = MelkRadar.Mgmt.Win.exe Calling assembly : MelkRadar.Core.Model, Version=18.104.22.168, Culture=neutral, PublicKeyToken=null. === LOG: This bind starts in default load context. LOG: Using application configuration file: H:\melkradar-git\melkradar\src\MelkRadar\Mgmt\MelkRadar.Mgmt.Win\bin\Debug\MelkRadar.Mgmt.Win.exe.config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: Microsoft.Azure.Cosmos.Table, Version=22.214.171.124, Culture=neutral, PublicKeyToken=31bf3856ad364e35 LOG: GAC Lookup was unsuccessful. LOG: Attempting download of new URL file:///H:/melkradar-git/melkradar/src/MelkRadar/Mgmt/MelkRadar.Mgmt.Win/bin/Debug/Microsoft.Azure.Cosmos.Table.DLL. LOG: Attempting download of new URL file:///H:/melkradar-git/melkradar/src/MelkRadar/Mgmt/MelkRadar.Mgmt.Win/bin/Debug/Microsoft.Azure.Cosmos.Table/Microsoft.Azure.Cosmos.Table.DLL. LOG: Attempting download of new URL file:///H:/melkradar-git/melkradar/src/MelkRadar/Mgmt/MelkRadar.Mgmt.Win/bin/Debug/Microsoft.Azure.Cosmos.Table.EXE. LOG: Attempting download of new URL file://
BTW, I've tried cleaning the solution, restarting VS, rebuilding and trying again, suggested in similar questions. it didn't work.
User contributions licensed under CC BY-SA 3.0