Reputation: 11299
How can I take several dll's in my bin folder for my ASP.NET application organize them into seperate folders and leave them under the bin directory so that they still are readily accesible to the application as if they were in the root of the bin? I want to reduce the monstrous list of dlls and group them into folders related to their core purpose.
Upvotes: 4
Views: 1455
Reputation: 6143
Are you trying to organize the dlls generated by the app after compilation or the 3rd party and external dlls used by your app?
If it is the latter and you are not doing so already you can organize these into any hierarchy you choose outside the app (but inside the solution). You can then reference the dlls from there.
Trying to organize the asp.net compiler generated files feels like swimming upstream.
Upvotes: 0
Reputation: 3336
There was an article Moving the Code-Behind Assemblies/DLLs to a different folder than /BIN with ASP.NET 1.1
I suppose the approach with using assemblyBinding Element for runtime can work for .NET 2.0 too
But I agree that it is not recommended...
Upvotes: 1
Reputation: 116977
You can make your application probe other directories for loading assemblies by using the web.config file and specifying a <probing>
element. I'm unclear as to whether or not this works now with website type projects, as it did not several years ago. It should, however, work with Web Application type projects.
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin\subdir"/>
</assemblyBinding>
</runtime>
<system.web>
....
....
</system.web>
</configuration>
Upvotes: 4
Reputation: 161773
Don't do that. Even if it works, it will not be understood by anyone else.
If you're bothered by the number of assemblies in the bin folder, then don't look there.
Upvotes: 1