Reputation: 10121
I am currently working on a C# project in Visual Studio 2010, and I need to use an assembly. I got it added as a project to my solution and got it to build and copy local to the output folder of my main project.
The problem is, for tidiness, I'd like to have it so that the assembly would go in bin/Debug/assemblies instead of bin/Debug, and that the reference of this assembly uses that.
Is this possible somehow?
Upvotes: 3
Views: 244
Reputation: 942227
This kind of "tidiness" is a massively bad idea. The CLR has no idea where to look for these assemblies and will not find them without a app.exe.config file. You'll need to provide one with the <probing>
element that names the subdirectory. You will also need a post-build event to create the directory with mkdir and xcopy to copy the files.
If this sounds like too many hoops to jump through then that's because DLL Hell is something you never want to mess with. Both the CLR and the build system strongly discourage it. There are only two places that the CLR considers unambiguous, the GAC and the directory that contains the startup EXE. Anything else is going to require extra steps to convince the CLR that you're not shooting your foot by accident.
Upvotes: 3
Reputation: 3804
Simply set the Output path to bin\Debug\assemblies, or whatever you like, in your project's properties.
Upvotes: 0