The Light
The Light

Reputation: 27011

How to have multiple bin folders in an asp.net application?

I have an asp.net application located in C:/MainApp which has a bin folder. In IIS I have configured this as a web application and I can run my test pages.

Now, I have 2 web service applications with their own dlls and I don't want to deploy those dlls in the main bin folder c:/MainApp/Bin for some reasons, please don't ask why! These 2 subapps need to be hosted under the same MainApp without creating a new Virtual Folder for each.

So,

c:/MainApp
c:/MainApp/bin
c:/MainApp/SubApp1/bin
c:/MainApp/SubApp2/bin

How to configure the webconfig so that my SubApp folders can have their own bin folders?

If so, would they inherit from the MainApp bin folder also at runtime?

many thanks,

Upvotes: 2

Views: 5795

Answers (2)

Iman
Iman

Reputation: 18906

1- Create a Bin folder yourself in the root folder of the website in IIS
2- Search for *.dll in your project and paste the DLLs in the Bin folder created in step 1 (it will find all the dlls inside inner bin folders)

i have fixed my missed assemblies in asp.net ckfinder + ckeditor apps hosted in IIS for testing

Upvotes: 0

Chris Shain
Chris Shain

Reputation: 51329

You can add an assemblyBinding element to your web.config to set multiple 'bin' paths:

<configuration>
   <runtime>   
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <probing privatePath="bin;SubApp1\bin;SubApp2\bin"/>
      </assemblyBinding>
   </runtime>   
</configuration>

This will cause your main web application to use DLLs from all of the bin paths in the probing element.

Upvotes: 7

Related Questions