简体   繁体   中英

How can I organize my dll's into multiple folders under the bin directory in ASP.NET?

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.

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> 

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.

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...

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM