Visual Studio 2015 RC - Cant add virtual directory

2019-07-21 14:48发布

问题:

I recently upgraded my machine which meant I had to install VS 2015 RC community

opened a previous project and had to recreate all my previous virtual directories only to find when I try I get the following error message:

'The operation could not be completed'

when simply selecting Add Virtual Directory, enter the name and path and press enter.

Anyone else had that or got an idea how I get round that?

回答1:

Maybe editting your applicationhostfile will help. The virtual paths must be part of the site

<!--path of your site-->
<site name="[NAMEOFSITE]" id="[SITEID]">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="[PATHTOSITE]" />
    </application>
    <!-- virtual path-->
    <application path="[VIRTUAL_PATH]" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="[PHYSICAL_PATH_OF_VIRTUAL]" />
     </application>
     <bindings>
         <binding protocol="http" bindingInformation="*:[PORTNUMBER]:localhost" />
     </bindings>
</site>