2014-06-04 16 views
6

這只是一個好奇/煩惱,並不是一個真正的問題。爲什麼我會在我的網站項目名稱的括號中得到一個數字?

我使用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 

回答

8

你可能有兩個網站使用相同的IIS綁定信息。如果我創建,刪除,然後重新創建網站,這通常發生在我身上。

找到你IISExpress文件夾(我的是在C:\用戶\布蘭登\文件\ IISExpress),然後去配置/對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> 
+0

完美!最後我知道爲什麼。 – sprocket12

+0

如果在該文件中找不到綁定,請嘗試按照Frederik Struck-Schøning的答案 –

2

檢查My Documents\IISExpress\config\applicationhost.config用記事本或類似的;應該有一個或多個條目與site (x)

[編輯] 布蘭登beat me to it 18數秒

5

我使用Visual Studio 2015和我只是刪除了我的解決方案的根文件夾.vs。它包含.vs\config\applicationhost.config.vs\mySolutionName\v14\.suo

編輯其中一個文件,可能會刪除舊的IIS Express綁定或其他東西,這可能是這樣做的好方法。但是重擊.vs文件夾和重新加載解決方案對我來說是個訣竅。

+0

中提到的'.vs \ config \ applicationhost.config'文件找到'.vs \ config \ applicationhost.config '文件並從那裏刪除它。現在看起來不錯,謝謝。 –

+1

不錯的一個。從來不知道存在! – Andez

相關問題