IIS express: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to

前端 未结 14 1776
旧巷少年郎
旧巷少年郎 2020-12-29 02:11

In Visual studio, Solution->Web.Project->Properties->Web, I have changed my Project Url from http://localhost:51123/ to http://localhost:51123/NewProj

相关标签:
14条回答
  • 2020-12-29 03:02

    Just Change the port number which is not yet used by another application and it works

    0 讨论(0)
  • 2020-12-29 03:05

    I think IIS Express probably has 2 <application>-blocks and both will be pointing to the same physicalPath.

    Go to the IIS Express config file in: My Documents\IISExpress\config\applicationhost.config

    Search for NewProjectName

    Change the physicalPath for the root application to something else. Point it to an empty folder.

    Should look something like this:

    <site name="NewProjectName" id="1">
      <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="c:\Temp" />
      </application>
      <application path="/NewProjectName" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="c:\sourcecode\NewProjectName" />
      </application>
      <bindings>
        <binding protocol="http" bindingInformation="*:51123:localhost" />
      </bindings>
    </site>
    
    0 讨论(0)
提交回复
热议问题