新的网站项目名称后显示的数字 [英] Number displayed after a new Web Site project's name

查看:128
本文介绍了新的网站项目名称后显示的数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Visual Studio的解决方案中删除了一个名为nPower.Ignition.WebResponsive的旧ASP.NET Web应用程序项目,但是当我在同一位置添加一个新的Web站点项目时,我看到了(1)附加在期望的末尾姓名.我尝试删除并重新创建了几次,现在到了解决方案浏览器中的样子,在想要的名称的末尾附加了(3)

I deleted an old ASP.NET Web Application project called nPower.Ignition.WebResponsive from my solution in Visual Studio, but when I added a new Web Site project in the same spot, I saw (1) appended at the end of my desired name. I tried to delete and recreate a few more times, and now I'm to the point where it looks like this in my solution explorer, with (3) appended on the end of my desired name!

所以...我几乎不知道是什么原因造成的,但不知道如何解决它.

So... I pretty much know what caused this, but not how to fix it.

Visual Studio是否记得我曾经在解决方案中有一个具有该名称的项目,即使我已经删除了该项目,并试图通过给它一个不同的名称来避免冲突?有什么办法可以消除结尾处附加的数字?我知道,如果我原样保留名称,从编程的角度来看可能不会有太大区别,但是看起来很草率!

Is Visual Studio remembering that I used to have a project with that name in my solution, even though I've deleted it, and trying to avoid a conflict by giving it a different name? Is there a way I can get rid of the number appended at the end? I understand it probably won't make much of a difference from a programming standpoint if I leave the name as is, but it looks quite sloppy!

推荐答案

之所以会发生这种情况,是因为每次使用IIS Express创建网站项目时,VS都会向IIS Express的applicationhost.config(C:\Users\YourName\Documents\IISExpress\config\applicationhost.config)中添加一个新条目.每个网站都必须是唯一的,因此VS会在名称后添加并增加数字.

This occurs because each time you create a Web Site project using IIS Express, VS adds a new entry to IIS Express' applicationhost.config (C:\Users\YourName\Documents\IISExpress\config\applicationhost.config). Each website needs to be unique, so VS will append and increment the number following the name.

要消除这一点,您需要清除applicationhost.config文件中的冲突条目.

To get rid of this, you need to clear out the conflicting entries in the applicationhost.config file.

在最新版本的Visual Studio中,applicationhost.config文件位于解决方案文件下的.vs\config文件夹中.

In more recent versions of Visual Studio, the applicationhost.config file is located in the .vs\config folder under the solution file.

这篇关于新的网站项目名称后显示的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆