I am not an expert on NuGet and have only limited experience with "nuget.exe", but I am pretty sure I understood what your actual problem is, and I think the following may be a conceptual solution:
On your build server, MySolution exists in two versions in parallel:
the last commited version
the "NuGet" version (which corresponds to the last time a feature branch was merged into 'dev', as you wrote, which is usually older).
(I assume the concept of updating the NuGet package at that time, and not at every commit was implemented intentionally, and you don't want to change it.)
Unfortunately, your tests exist currently only in one version:
- a version which corresponds to the last commited version of MySolution
And since this version references the NuGet version, these two do not fit together any more.
The solution to this is to create two versions/variants of the tests as well:
one version which corresponds to the last commited version of MySolution and references exactly that one and nothing else, (so especially in the "Release" configuration, by referencing the "Release" mode DLLs of MySolution).
one version which corresponds to the NuGet version of MySolution, and references that one via NuGet. This version should be updated exactly at the point in time, and only at that point in time, when the NuGet package will be updated, i.e. when a feature branch is merged into the 'dev' branch.
So I would recommend to setup these two variants of the test project. In the first one you actually work and extend the tests. The second one should be updated by some automatism from the former, but only and precisely at the point in time when the NuGet package is updated. For example, there could be copy script which simply copies the source code files from the first folder over to the second, whilst the project file(s) of the tests are patched to replace the DLL reference by the NuGet reference. There are some other solutions possible, depending on the precise tooling, but I hope you get the idea.
Now call this "copy script" exactly when you merge the feature branch into dev. Depending on your tooling, it may also be possible to make the script do both steps in one: copying the tests and merging the feature branch.
You (hopefully) end up with two test sets:
one which tests your latest commited development version (and could exists in a debug as well as a release configuration as well, if you need both)
one which tests you latest NuGet package.
Both can (and should) be executed on the build server.
In short, "the push to NuGet" operation requires a corresponding "push regular tests to NuGet tests" operation, that should solve your issues.