11

how do i add new virtual directory?

I'm getting error (The type or namespace name 'xxx' could not be found) but the files are all in /bin.

i have tried editing the applicationhost.config like this:

<site name="WebSite1" id="1" serverAutoStart="true">
    <application path="/" applicationPool="Clr2IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
        <virtualDirectory path="/SubFolderApp" physicalPath="%IIS_SITES_HOME%\WebSite1\SubFolderApp" allowSubDirConfig="true" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation=":80:localhost" />
    </bindings>
</site>
skaffman
  • 398,947
  • 96
  • 818
  • 769
khalil
  • 326
  • 1
  • 4
  • 16
  • What is "xxx"? I don't see those letters in your example. – John Saunders Jan 19 '11 at 04:02
  • Although you have this problem with IIS Express (a Developer tool), I doubt the problem is any different from IIS. I voted to migrate this to serverfault.com – John Saunders Jan 19 '11 at 04:04
  • im sorry, xxx is just a .dll file in /bin. for example Facebook.dll . ohh sorry, i forgot about the existence of serverfault.com. or why is the tag even possible here ? – khalil Jan 19 '11 at 06:13
  • ohh yah, i forgot to tell that, if the app is in root folder, it can run all .dll files in /bin, but if the app is in a subfolder (/SubFolderApp), it will show the namespace not found error. so i suspected that any subfolder is not registered as an application. that is why im asking how to add new virtual dir so that i can have /SubFolderApp as a stand alone app instead of 1 app in root folder. – khalil Jan 19 '11 at 06:32

1 Answers1

20

You need to create a child application. Your configuration created child virtual directory. The configuration below turns /SubFolderApp into an application.

<site name="WebSite1" id="1" serverAutoStart="true">
   <application path="/" applicationPool="Clr2IntegratedAppPool">
     <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
   </application>
   <application path="="/SubFolderApp" applicationPool="Clr2IntegratedAppPool">
     <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1\SubFolderApp" />
   </application>
    <bindings>
      <binding protocol="http" bindingInformation=":80:localhost" />
   </bindings>
</site>
Jaro Dunajsky
  • 2,003
  • 14
  • 8