We're developing an app with a postgreSQL db backend (actually enterprise db)
Being in the process of writing unit tests for classes doing some db queries, I started using linq and llblgen to prepare db context for unit testing.
The testing framework used is nunit. When I run tests, the nunit output started complaining about a missing npgsql assembly (although npgsql assembly (version 126.96.36.199) is referenced in the test project) :
System.IO.FileLoadException : Could not load file or assembly 'Npgsql, Version=188.8.131.52, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
The point is: in our startup project, it seems like we had to use an assembly redirect (in the app.config) to make the app stop complaining about the missing npgsql 1.0 dll, and link to the 2.0.6 one.
But in the context I can't tell nunit program how to redirect (except adding a redirect to the machine configuration, which I can't !)
So the question is :
Why does llblgen libs seem to search for a specific version of npgsql (184.108.40.206) with a public key token matching the 2.0.6 dll ? Where and how can I edit (template, generated project, ...) to fix this unit test runtime issue ?
Thank you for your suggestions,
I had to update Npgsql assembly reference (to 220.127.116.11) in PostgreSqlDQE project, then rebuilt ORM, DQE and LinqSupport, before recompiling our projects referencing llblgen classes.
I rebuilt my NUnit test project assembly and it worked flawlessly without even having to edit nunit app.config file for assembly redirection.
Our app is now only referencing the latest npgsql assembly version.
Note it was a pain to troubleshoot the error since it was only occurring at runtime, probably because llblgen runtime libs try to load an assembly using reflection or Assembly.Load
I was able to reproduce this issue with a clean install of LLBLGen 5.9 with the version of Npgsql installed in the 'C:\Program Files (x86)\Solutions Design\LLBLGen Pro v5.9\Drivers\PostgreSql' folder.
The Npsql.dll is '.NetStandard v2.0' while the SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.dll is '.Net Framework v4.7.2'.
so it looks like a .Net version clash?
You're replying to a thread that's 13 years old. I doubt it's the same issue. The Npgsql shipped with the designer is one which we know works with the designer on .net framework. I have no idea what issue you run into so start a new thread with a description of your problem.