为什么我的网站项目名称中的括号中有一个数字?

时间:2014-06-04 22:36:56

标签: asp.net web visual-studio-2013

这只是一种好奇心/烦恼而不是真正的问题。

我有一个使用VS 2013的Web表单网站项目。不知何故,项目名称在名称中包含(1)(2),我有尝试编辑解决方案文件,删除所有其他网站,重建/清理等,仍然无法弄清楚从哪里获得(2)

enter image description here

解决方案文件:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Web
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Site", "http://localhost:52806", "{5411FD57-5AFE-4A3A-9474-0DCD64C89003}"
    ProjectSection(WebsiteProperties) = preProject
        UseIISExpress = "true"
        TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
        Debug.AspNetCompiler.VirtualPath = "/localhost_52806"
        Debug.AspNetCompiler.PhysicalPath = "..\..\..\..\..\..\Dropbox\Projects\Site\"
        Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_52806\"
        Debug.AspNetCompiler.Updateable = "true"
        Debug.AspNetCompiler.ForceOverwrite = "true"
        Debug.AspNetCompiler.FixedNames = "false"
        Debug.AspNetCompiler.Debug = "True"
        Release.AspNetCompiler.VirtualPath = "/localhost_52806"
        Release.AspNetCompiler.PhysicalPath = "..\..\..\..\..\..\Dropbox\Projects\Site\"
        Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_52806\"
        Release.AspNetCompiler.Updateable = "true"
        Release.AspNetCompiler.ForceOverwrite = "true"
        Release.AspNetCompiler.FixedNames = "false"
        Release.AspNetCompiler.Debug = "False"
        SlnRelativePath = "..\..\..\..\..\..\Dropbox\Projects\Site\"
    EndProjectSection
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {5411FD57-5AFE-4A3A-9474-0DCD64C89003}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {5411FD57-5AFE-4A3A-9474-0DCD64C89003}.Debug|Any CPU.Build.0 = Debug|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
EndGlobal

3 个答案:

答案 0 :(得分:9)

您可能有两个具有相同IIS绑定信息的站点。如果我创建,删除,然后重新创建一个网站,这通常会发生在我身上。

找到你的IISExpress文件夹(我的是C:\ Users \ brandon \ Documents \ IISExpress),然后转到config / applicationhost.config

使用重复绑定查找您的站点名称,然后删除<site>节点。它看起来像这样

<site name="WEBSITENAME" id="21">
    <application path="/" applicationPool="Clr2IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\Users\...\YourProject" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:SomePortNumber:localhost" />
    </bindings>
</site>

答案 1 :(得分:8)

我正在使用Visual Studio 2015,我只是删除了解决方案根目录中的.vs文件夹。它包含.vs\config\applicationhost.config.vs\mySolutionName\v14\.suo

编辑其中一个文件,可能删除旧的IIS Express绑定或其他东西,可能是这样做的好方法。但是打击.vs文件夹并重新加载解决方案对我来说很有用。

答案 2 :(得分:2)

用记事本或类似物品检查My Documents\IISExpress\config\applicationhost.config;应该有一个或多个条目site (x)

[编辑] 布兰登beat me to it 18秒......