Search code examples
visual-studiomsbuild64-bit

Visual Studio 2019 not copying changed and compiled dll to startup project's bin folder in x64 target


I have a (mostly C#) solution that needs to build in x64 because I integrate with a C++ project, so I had to choose a platform.

I noticed that my code changes don't always show up at runtime and I found out that when Solution is Debug x64 it compiles the changed project but does not copy the dll to the bin of the startup project, so the debug session uses an older version of that dll.

I tried most variations of building, and the dll-copy never happens, except when I rebuild the startup project, or the solution, obviously...

When on AnyCpu, all works perfectly all the time. So, alternate solution: maybe I can use the C++ project and keep my C# projects on anycpu?

All projects are enabled in the solution config for both anycpu and x64.

Any suggestions I could look out for?


Solution

  • Because the problematic project was a dependency of a dependency of the startup assembly, I tried adding a direct reference to it from the startup project. The issue disappeared...

    Of course, I prefer not having refs that aren't really necessary, so when I removed that new reference again, it kept working. So, now I cannot simulate the issue anymore.

    Using git the only change I can see is that the ProjectReference is now a lowercase guid, and it was uppercase... This probably happened when I gave re-referenced the project a try earlier... odd stuff shrug