I have 5 projects in my .net c# solution. I have changed each of the projects platform to x64 in Build's platform target (This was initially 'Any CPU') and the project worked fine.
Then I changed the platform in solution properties using configuration manager in solution properties (Right Click on Solution -> Properties)
Then I changed then back to Any CPU. But I can not build the solution. There are many errors saying that dlls of each project can not be found.
One thing I noticed when I changed the platform in solution properties and built the built has changed from bin/debug to bin/x64/debug (I am running in debug mode)
Ex error :
Metadata file '[project path]\bin\Debug\Thahavuru.DataAccessLayer.dll' could not be found
I am confused of what has to build the project successfully back again. Help is greatly appreciated.
Tinkering with the solution's Platform selection is always wrong. It is a setting that only matters to C++ projects. Managed projects get compiled to assemblies that contain MSIL, they run on any platform. It is the jitter's job to take care of this, that happens at runtime and not at build time.
It does matter for C++ projects because they get compiled to the target architecture at build time. A 64-bit DLL or EXE generated from C++ code is very different from a 32-bit one, it contains very different machine code.
A pure managed solution should therefore have only one Platform selection. Which is "AnyCPU" in old VS versions. And again in new VS versions. Microsoft fumbled it badly at VS2010 when they started creating projects that have "x86" as the default Platform selection. Creating all sorts of misery with solutions that have a drastic mix of platforms when they got upgraded from an old version of VS.
Sounds like you've dug yourself an even deeper hole where the assemblies are getting built to bin\x64\debug but the reference assemblies are still pointing to bin\debug. No real idea how you did this, you must always use project references in a solution with multiple projects that depend on each other.
I recommend serious slash-and-burn to get this problem resolved:
maybe you can try to build each project separatly first. if the dll is not found it simply mean that the DataAccessLayer project is not building with success. then if it failed alone you can try to edit the cs.proj maybe you have remaining option in it. Or maybe try to add a post build instruction to each of your project which say after building with success copy myself in debug directory.
hope it helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With