Я использовал vs2010 и webmatrix. Тем не менее, я пытаюсь использовать apache в последнее время.
Поэтому мой IIS express использует порт 80, а apache использует порт 8080.
Я намерен сделать это наоборот. Пусть apache использует порт 80, а IIS — 8080.
Я не мог позволить апашу слушать порт 80, пока IIS перестанет слушать порт 80.
Как мне настроить порт IIS express?
ps.Я использую win7 с одним IP-адресом
Ответ 1
Попробуйте это
Чтобы настроить веб-сайт IIS по умолчанию для использования порта 8080
На рабочем столе Windows нажмите кнопку «Пуск», «Администрирование», затем «Диспетчер служб IIS».
В диспетчере служб IIS на панели «Соединения» разверните имя компьютера, «Сайты» и нажмите «Веб-сайт по умолчанию».
На панели «Действия» в разделе «Редактировать сайт» нажмите «Привязки».
В диалоговом окне «Связывание сайтов» щелкните запись http и нажмите «Изменить».
В диалоговом окне «Изменить привязку сайта» в «Порт» введите 8080 и нажмите «ОК».
В диалоговом окне «Связывание сайтов» нажмите «Закрыть».
На панели «Действия» в разделе «Управление веб-сайтом» нажмите «Стоп», а затем «Пуск».
Ответ 2
Microsoft Internet Information Services 7.0
1. Open Internet Information Services (IIS) Manager. Select the Web.
2. site that you wish to configure. In the Action pane, click Bindings.
3. Click Add to add a new site binding, or click Edit to change an existing binding.
4. Click OK to apply the changes.
Источник — Как изменить порт для служб IIS
Ответ 3
IIS 8.1
- Выберите «Веб-сайт по умолчанию» из дерева слева в диспетчере IIS.
- Нажмите «Привязки» с правой боковой панели, чтобы открыть диалоговое окно.
- Выберите запись «http» из сетки и нажмите «Изменить».
- Введите свой номер порта в текстовом поле «Порт» и нажмите «ОК».
Ответ 4
Как изменить порт IIS в Windows Опубликовано 21 ноября 2017 г. Сурешем Камруши в Windows [Мне нравится] +2 [В отличие от] 0 Спасибо за ваш голос.
Здесь показано, как вы можете обновить номер порта сервера IIS в системе Windows 10/8. Может быть несколько причин, по которым вы хотите изменить порт, но для меня это WAMP, я использую его для проектов PHP. IIS и WAMP используют один и тот же порт, что затрудняет разработку. Поэтому я обновил порт IIS. Вы также можете обновить порт WAMP, ссылаясь на мой блог. Чтобы обновить номер порта сервера IIS, выполните следующие действия:
- Начните и введите IIS
- IIS Manager откроется. нажмите «Веб-сайт по умолчанию» на левой стороне.
- нажмите на «привязки…» в правой части раздела действий.
- Всплывающее окно откроется с 80 портами в списке. выберите его и нажмите кнопку редактирования.
- Обновите порт и перезапустите сервер.
источник: http://sforsuresh.in/change-iis-port-windows/
I want to change the port number on which my website runs while debugging from Visual Studio. I am using Visual Studio 2012, and I am using ASP.NET MVC 4 for my projects I want to change the port. Random port or fixed anyone will work just want to change the port.
asked Jan 18, 2014 at 10:31
To specify a port for a Web application project that uses IIS Express
In Solution Explorer, right-click the name of the application and then select Properties.
Click the Web tab.In the Servers section, under Use Local IIS Web server, in the Project URL box change the port number.
To the right of the Project URL box, click Create Virtual Directory, and then click OK.
In the File menu, click Save Selected Items.
To verify the change, press CTRL+F5 to run the project.
The new port number appears in the address bar of the browser.
From How to: Specify a Port for the Development Server (archive.org backup here).
dbc
99k20 gold badges214 silver badges323 bronze badges
answered Jan 18, 2014 at 10:34
hutchonoidhutchonoid
32.8k14 gold badges98 silver badges104 bronze badges
6
Here’s a more manual method that works both for Website projects and Web Application projects. (you can’t change the project URL from within Visual Studio for Website projects.)
Web Application projects
-
In Solution Explorer, right-click the project and click Unload Project.
-
Navigate to the IIS Express ApplicationHost.config file. By default, this file is located in:
%userprofile%DocumentsIISExpressconfigIn recent Visual Studio versions and Web Application projects, this file is in the solution folder under
[Solution Dir].vsconfigapplicationhost.config(note the .vs folder is a hidden item) -
Open the ApplicationHost.config file in a text editor. In the
<sites>section, search for your site’s name. In the<bindings>section of your site, you will see an element like this:<binding protocol="http" bindingInformation="*:56422:localhost" />Change the port number (56422 in the above example) to anything you want. e.g.:
<binding protocol="http" bindingInformation="*:44444:localhost" />Bonus: You can even bind to a different host name and do cool things like:
<binding protocol="http" bindingInformation="*:80:mysite.dev" />and then map
mysite.devto127.0.0.1in yourhostsfile, and then open your website from «http://mysite.dev» -
In Solution Explorer, right-click the the project and click Reload Project.
-
In Solution Explorer, right-click the the project and select Properties.
-
Select the Web tab.
-
In the Servers section, under Use Local IIS Web server, in the Project URL box enter a URL to match the hostname and port you entered in the ApplicationHost.config file from before.
-
To the right of the Project URL box, click Create Virtual Directory. If you see a success message, then you’ve done the steps correctly.
-
In the File menu, click Save Selected Items.
-
Website projects
-
In Solution Explorer, right-click the project name and then click Remove or Delete; don’t worry, this removes the project from your solution, but does not delete the corresponding files on disk.
-
Follow step 2 from above for Web Application projects.
-
In Solution Explorer, right-click the solution, select Add, and then select Existing Web Site…. In the Add Existing Web Site dialog box, make sure that the Local IIS tab is selected. Under IIS Express Sites, select the site for which you have changed the port number, then click OK.
Now you can access your website from your new hostname/port.
answered Mar 5, 2014 at 18:47
Saeb AminiSaeb Amini
22.2k8 gold badges75 silver badges76 bronze badges
9
.Net Core
For those who got here looking for this configuration in .Net core this resides in the PropertieslauchSettings.json. Just edit the port in the property "applicationUrl".
The file should look something like this:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:53950/", //Here
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "index.html",
"environmentVariables": {
"Hosting:Environment": "Development"
},
}
}
}
Or you can use the GUI by double clicking in the «Properties» of your project.
Note: I had to reopen VS to make it work.
answered Jun 17, 2016 at 19:02
fabriciorissettofabriciorissetto
9,1375 gold badges64 silver badges72 bronze badges
3
Right click on your MVC Project. Go to Properties. Go to the Web tab.
Change the port number in the Project Url. Example. localhost:50645
Changing the bold number, 50645, to anything else will change the port the site runs under.
Press the Create Virtual Directory button to complete the process.
See also: http://msdn.microsoft.com/en-us/library/ms178109.ASPX
Image shows the web tab of an MVC Project
answered Jan 18, 2014 at 12:50
Ashley MedwayAshley Medway
7,0917 gold badges51 silver badges70 bronze badges
1
If you just want to change the port because it is already in use. Follow the following steps.
In Visual studio
- Right-click on Project Node and select
Unload Project - Right-click on Project Node and Edit .csproj file.
- Search for the following tags and remove them
<DevelopmentServerPort>62140</DevelopmentServerPort> <DevelopmentServerVPath></DevelopmentServerVPath> <IISUrl>http://localhost:62116/</IISUrl>
- press Ctrl + S to save the document
- Right-click on Project Node and load Project
It will work by selecting another port randomly.
For further information. please click
ΩmegaMan
28.3k10 gold badges98 silver badges117 bronze badges
answered Oct 2, 2019 at 7:49
CharlieCharlie
4,7512 gold badges30 silver badges54 bronze badges
Another fix for those who have IIS Installed:
Create a path on the IIS Server, and allocate your website/app there.
Go to propieties of the solution of the explorer, then in front of using the iisexpress from visual studio, make that vs uses your personal own IIS.
Bhargav Rao
48.7k28 gold badges124 silver badges139 bronze badges
answered Jan 6, 2016 at 16:18
You can first start IIS express from command line and give it a port with /port:port-number
see other options.
answered Nov 7, 2017 at 15:04
John HenckelJohn Henckel
9,8043 gold badges75 silver badges77 bronze badges
If we are talking about a WebSite, not web app, my issue was that the actual .sln folder was somewhere else than the website, and I had not noticed. Look for the .sln path and then for the .vs (hidden) folder there.
answered Jun 11, 2019 at 10:54
SentinelSentinel
3,5521 gold badge29 silver badges42 bronze badges
For old Website projects you will need to modify port in solution file, find section similar to below and change «VWDPort» property
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "My Website", "My Website", "{871AF49A-F0D6-4B10-A80D-652E2411EEF3}"
ProjectSection(WebsiteProperties) = preProject
SccProjectName = "<Project Location In Database>"
SccAuxPath = "<Source Control Database>"
SccLocalPath = "<Local Binding Root of Project>"
SccProvider = "Mercurial Source Control Package"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.7.2"
ProjectReferences = "{41176de9-0c21-4da1-8532-4453c9cbe289}|My.CommonLibrary.dll;{f1fda4e5-0233-458e-97b8-381bdb38a777}|My.Ajax.dll;{e756176c-9cd1-4dac-9b2d-9162b7554c70}|My.WEB.API.Domain.dll;{7A94A6C8-595B-43CF-9516-48FF4D8B8292}|My.WEB.API.Common.dll;{790654F2-7339-472C-9A79-9E36837571A0}|My.Api.dll;{25aa245b-89d9-4d0c-808d-e1817eded876}|My.WEB.API.DAL.dll;{cc43d973-6848-4842-aa13-7751e655966d}|My.WEB.API.BLL.dll;{41591398-b5a7-4207-9972-5bcd693a9552}|My.FacialRecognition.dll;"
Debug.AspNetCompiler.VirtualPath = "/My Website"
Debug.AspNetCompiler.PhysicalPath = "My Website"
Debug.AspNetCompiler.TargetPath = "PrecompiledWebMy Website"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/My Website"
Release.AspNetCompiler.PhysicalPath = "My Website"
Release.AspNetCompiler.TargetPath = "PrecompiledWebMy Website"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "3883"
SlnRelativePath = "My Website"
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
{C3A75E14-1354-47CA-8FD6-0CADB80F1652} = {C3A75E14-1354-47CA-8FD6-0CADB80F1652}
EndProjectSection
EndProject
answered Feb 12, 2021 at 15:43
user7313094user7313094
4,2702 gold badges23 silver badges35 bronze badges
For web projects:
- Close Visual Studio
- Open [projectName].sln in solution root directory using a text editor (like sublime)
- Search your current port number you will find 5 instances
- Replace them with new port number and save file
- Delete .vs file in the solution root directory
- Start visual studio then the .vs file will be created again. run the web project it will start with new port
answered Sep 12, 2021 at 5:30
Edit .sln file using an editor like notepad.
Replace All Ports With New Port.
answered Sep 2, 2016 at 8:04
aDDinaDDin
533 bronze badges
1
I’d the same issue on a WCF project on VS2017. When I debug, it gives errors like not able to get meta data, but it turns out the port was used by other process. I got some idea from here, and finally figure out where the port was kept. There are 2 places:
1. C:…to your solution folder….vsconfigapplicationhost.config. Inside, you can find the site that you debug. Under , remove the that has port issue.
2. C:…to your project folder…, you will see a file with ProjectName.csproj.user. Remove this file.
So, close the solution, remove the and the user file mentioned above, then reopen the solution, VS will find another suitable port for the site.
answered Sep 5, 2019 at 21:22
I’m using VS 2019.
if your solution has more than one project / class libraries etc, then you may not see the Web tab when clicking on Solution explorer properties.
Clicking on the MVC project and then checking properties will reveal the web tab where you can change the port.
answered Nov 21, 2019 at 7:20
ShaakirShaakir
4345 silver badges13 bronze badges
Deploy your application in the IIS with the default port. Try to debug it using visual studio. It’s a good practice. If you use visual studio, it will keep changing the port number most of the time. So better deploy the application in the IIS first and Open the same in visual studio and Debug it.
answered Jan 18, 2014 at 12:39
WikiWiki
921 silver badge8 bronze badges
2
Я хочу изменить номер порта, на котором работает мой сайт во время отладки из Visual Studio. Я использую Visual Studio 2012, и я использую ASP.NET MVC 4 для моих проектов я хочу изменить порт. Случайный порт или фиксированный кто-то будет работать просто хочет изменить порт.
887
8
8 ответов:
чтобы указать порт для проекта веб-приложения, использующего IIS Express
в обозревателе решений щелкните правой кнопкой мыши имя приложения и выберите пункт Свойства.
Перейдите на вкладку Веб.в разделе серверы в разделе использование локального веб-сервера IIS в поле URL-адрес проекта измените номер порта.
справа от поля URL-адрес проекта щелкните создать виртуальный каталог, а затем нажмите кнопку ЛАДНО.
в меню Файл выберите команду сохранить выбранные элементы.
чтобы проверить изменение, нажмите CTRL+F5 для запуска проекта.
Новый номер порта появится в адресной строке браузера.С как: укажите порт для сервера разработки (archive.org резервное копирование здесь).
вот более ручной метод, который работает как для сайт проектов Веб-Приложения проектов. (вы не можете изменить URL-адрес проекта из Visual Studio для проектов веб-сайтов.)
чтобы указать порт для любого веб-проекта, использующего IIS Express:
в обозревателе решений щелкните правой кнопкой мыши имя проекта и выберите команду удалить или удалить; не волнуйтесь, это удаляет проект из вашего решения, но не удаляет соответствующие файлы на диске.
перейдите к IIS Express ApplicationHost.конфигурации. По умолчанию этот файл находится в:
%userprofile%DocumentsIISExpressconfigоткрыть ApplicationHost.конфигурации файл в текстовом редакторе. В
<sites>раздел, Поиск имени вашего сайта. В<bindings>раздел вашего сайта, вы будете см. такой элемент:
<binding protocol="http" bindingInformation="*:56422:localhost" />измените номер порта (56422 в приведенном выше примере) на все, что вы хотите. например:
<binding protocol="http" bindingInformation="*:44444:localhost" />(бонус: вы даже можете привязать к другому имени хоста и делать классные вещи, как:
<binding protocol="http" bindingInformation="*:80:mysite.dev" />а потом карта
mysite.devдо127.0.0.1в своемhostsфайл, а затем откройте свой сайт из «http://mysite.Дев»; но это выходит за рамки этот ответ, поэтому я не буду вдаваться в подробности)если бы у вас был сайт:
в обозревателе решений щелкните правой кнопкой мыши решение, выберите Добавить, а затем выберите Существующий Веб-Сайт…. В диалоговом окне Добавление существующего веб-узла убедитесь, что выбрана вкладка локальные службы IIS. В разделе сайты IIS Express выберите сайт, для которого был изменен номер порта, а затем нажмите кнопку ОК.
если бы у вас был Web Применение:
в обозревателе решений щелкните правой кнопкой мыши решение, выберите Добавить, а затем выберите Существующий Проект… найдите и выберите файл проекта веб-приложения. Затем:
в обозревателе решений щелкните правой кнопкой мыши имя проекта и выберите Свойства. Перейдите на вкладку Веб.
в разделе серверы в разделе использование локального веб-сервера IIS в поле URL-адрес проекта введите URL-адрес сопоставьте имя хоста и порт, который вы ввели в ApplicationHost.конфигурации файл из прошлого.
справа от поля URL-адрес проекта щелкните создать виртуальный каталог, а затем нажмите кнопку ОК.
в меню Файл выберите команду сохранить выбранные элементы.
теперь вы можете получить доступ к вашему сайту из вашего нового имени хоста/порта.
щелкните правой кнопкой мыши на вашем проекте MVC. Перейдите в раздел Свойства. Перейдите на вкладку Web.
Измените номер порта в Url-адресе проекта. Образец. localhost:50645
Изменение полужирного номера, 50645, на что-либо еще изменит порт, под которым работает сайт.
Нажмите кнопку Создать Виртуальный Каталог кнопка для завершения процесса.Смотрите также: http://msdn.microsoft.com/en-us/library/ms178109.ASPX
изображение показывает веб-вкладку проекта MVC
.Net Core
для тех, кто попал сюда в поисках этой конфигурации в.Net core это находится в
lauchSettings.json. Просто отредактируйте порт в свойстве"applicationUrl".файл должен выглядеть примерно так:
{ "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:53950/", //Here "sslPort": 0 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "launchUrl": "index.html", "environmentVariables": { "Hosting:Environment": "Development" }, } } }или вы можете использовать графический интерфейс, дважды щелкнув int «свойства» проекта yor.
Примечание: мне пришлось снова открыть VS, чтобы заставить его работать.
еще одно исправление для тех, у кого установлены IIS:
создайте путь на сервере IIS и выделите там свой веб-сайт/приложение.
перейти к propieties решения проводника, а затем перед использованием iisexpress из visual studio, сделать, что vs использует свой собственный IIS.
вы можете сначала запустить IIS express из командной строки и дать ему порт с /port:port-number
смотрите другие функции.
Edit .sln file С помощью редактора, например, Блокнота.
Заменить Все Порты На Новый Порт.
разверните приложение в IIS с портом по умолчанию. Попробуйте отладить его с помощью visual studio.It это хорошая практика.если вы используете Visual Studio,он будет постоянно менять номер порта большую часть времени.Поэтому лучше развернуть приложение на IIS сначала и открыть то же самое в Visual Studio и отлаживать его.




