Changing project port number in Visual Studio 2013 - c#

How can I change the project port number in Visual Studio 2013 ?
I'm using ASP.Net and I need to change the port number while debugging in Visual Studio 2013.

There are two project types in VS for ASP.NET projects:
Web Application Projects (which notably have a .csproj or .vbproj file to store these settings) have a Properties node under the project. On the Web tab, you can configure the Project URL (assuming IIS Express or IIS) to use whatever port you want, and just click the Create Virtual Directory button. These settings are saved to the project file:
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<DevelopmentServerPort>10531</DevelopmentServerPort>
...
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
Web Site Projects are different. They don't have a .*proj file to store settings in; instead, the settings are set in the solution file. In VS2013, the settings look something like this:
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WebSite1(1)", "http://localhost:10528", "{401397AC-86F6-4661-A71B-67B4F8A3A92F}"
ProjectSection(WebsiteProperties) = preProject
UseIISExpress = "true"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5"
...
SlnRelativePath = "..\..\WebSites\WebSite1\"
DefaultWebSiteLanguage = "Visual Basic"
EndProjectSection
EndProject
Because the project is identified by the URL (including port), there isn't a way in the VS UI to change this. You should be able to modify the solution file though, and it should work.

Right click the web application and select "properties"
There should be a 'Web' tab where http://localhost:XXXXX is specified - change the port number there and this will modify the configuration to use your new port number.
I usually start at 10000 and increment by 1 for each web app, to attempt to steer well clear of other applications and port numbers.

This has proved to be elusive for me (WebSite Project) until I figured out the following procedure, which combines the solution provided by #Jimmy, with the added step of checking out the solution from Source Control
Steps: (if using VS2013+ with website project and SourceControl)
Check out the Solution file only (from sourceControl) (this can be tricky. the easiest way to do this is to make a small change in the Solution file properties/settings and then undo if necessary)
Locate the solution file (e.g. solution.sln) in exploer, and open in text editor.
Locate the entry: VWDPort = ...... and change to desired port: (example: "60000" - depends on your IISExpress Settings)
save the change (will prompt to reload solution)

Well, I simply could not find this (for me) mythical "Use dynamic ports" option. I have post screenshots.
On a more constructive note, I believe that the port numbers are to be found in the solution file AND CRUCIALLY cross referenced against the IIS Express config file
C:\Users\<username>\Documents\IISExpress\config\applicationhost.config
I tried editing the port number in just the solution file but strange things happened. I propose (no time yet) that it needs a consistent edit across both the solution file and the config file.

Open Solution file (.sln) in Editable mode (Notepad or notepad++ or any other tool)
Find tag name VMDPort and update it to your desired port.
see below snap.

To specify a port for the ASP.NET Development Server
In Solution Explorer, click the name of the application.
In the Properties pane, click the down-arrow beside Use dynamic ports
and select False from the dropdown list.
This will enable editing of the Port number property.
In the Properties pane, click the text box beside Port number and
type in a port number. Click outside of the Properties pane. This
saves the property settings.
Each time you run a file-system Web site within Visual Web Developer,
the ASP.NET Development Server will listen on the specified port.
Hope this helps.

The Visual Studio Development Server option applies only when you are
running (testing) the Web project in Visual Studio. Production Web
applications always run under IIS.
To specify the Web server for a Web site project
In Solution Explorer, right-click the name of the Web site project for which you want to specify a Web server, and then click Property
Pages.
In the Property Pages dialog box, click the Start Options tab.
Under Server, click Use custom server.
In the Base URL box, type the URL that Visual Studio should start when running the current project.
Note: If you specify the URL of a remote server (for example, an IIS Web application on another computer), be sure that the remote server is running at least the .NET Framework version 2.0.
To specify the Web server for a Web application project
In Solution Explorer, right-click the name of the Web application project for which you want to specify a Web server, and then click
Properties.
In the Properties window, click the Web tab.
Under Servers, click Use Visual Studio Development Server or Use Local IIS Web server or Use Custom Web server.
If you clicked Local IIS Web server or Use Custom Web Server, in the Base URL box, type the URL that Visual Studio should start when
running the current project.
Note: If you clicked Use Custom Web Server and specify the URL of a remote server (for example, an IIS Web application on another computer), be sure that the remote server is running at least the .NET Framework version 2.0.
(Source: https://msdn.microsoft.com/en-us/library/ms178108.aspx)

Steps to resolve this:
Open the solution file.
Find the Port tag against your project name.
Assign any different port as current.
Right click on your project and select Property Pages.
Click on Start Options tab and checked Start URL: option.
Assign the start URL in front of Start URL option like: localhost:8080/login.aspx

This is the only solution that worked for me after trying several of those above. Switch to your c:\users folder and search for .sln and then remove all .sln files that have your project name. Then restart your computer and rebuild the solution (F5) and it worked!

Related

Visual studio 2013: Manually specify localhost port no. for website project

I am working on an angular project in visual studio.
I have created a Blank solution visual studio then added the existing website.
Open VS>>New Project>>Blank Solution>>Right click solution>>Add existing web site>>select Folder>>F5
Due to some reason I have to run the website on the localhost:8080 but the visual studio is setting the port itself.
How to change the running port to 8080
I have googled a lot but the only solutions I found is for ASP.net.
like
stackover flow,
microsoft docs
Alt+Enter is opening this property window
You can change the port in the Properties page of the project.
Right click the project and go to Properties or Alt + Enter.
Properties > Web.
Under Servers section, select "Specific Port" and provide one. :)
You can't change the project URL from within Visual Studio for Website projects.
There are two working methods for me, Posting this answer after testing.
First Option
Web Site Projects don't have a .*proj file to store settings instead, the settings are set in the solution file. In VS2013, the settings look something like this:
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "TestWebSite", "http://localhost:56422", "{401397AC-86F6-4661-A71B-67B4F8A3A92F}"
ProjectSection(WebsiteProperties) = preProject
UseIISExpress = "true"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5"
...
SlnRelativePath = "..\..\WebSites\WebSite1\"
DefaultWebSiteLanguage = "Visual Basic"
EndProjectSection
EndProject
Because the project is identified by the URL (including port), there isn't a way in the Visual studio UI to change this. You should be able to modify the solution file though, and it should work.
Note: In your case to set the port to 8080 you must open visual studio in Run as Administrator mode. You MUST run Visual Studio as an administrator in order to open websites with a port less than 1000
Credit of this option goes to Jimmy and original answer is here
Second Option
To specify a port for any web site project that uses IIS Express:
First Add the existing website and run it once. So that it gets assigned in the IIS sites list.
In project go to 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.
Navigate to the IIS Express ApplicationHost.config file. By default, this file is located in:
%systemdrive%\Users\<YourWindowsUsername>\Documents\IISExpress\config
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="*:8080:localhost" />
and then map mysite.dev to 127.0.0.1 in your hosts file, and then open your website from "http://mysite.dev"; but that's outside the scope of this answer so I won't go into any more details)
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.
Credit of this option goes to Saeb Amini and the original answer is here

How can I change IIS Express port for a site

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.
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).
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%\Documents\IISExpress\config
In recent Visual Studio versions and Web Application projects, this file is in the solution folder under [Solution Dir]\.vs\config\applicationhost.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.dev to 127.0.0.1 in your hosts file, 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.
.Net Core
For those who got here looking for this configuration in .Net core this resides in the Properties\lauchSettings.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.
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
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
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.
You can first start IIS express from command line and give it a port with /port:port-number
see other options.
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.
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 = "PrecompiledWeb\My 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 = "PrecompiledWeb\My 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
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
Edit .sln file using an editor like notepad.
Replace All Ports With New Port.
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....vs\config\applicationhost.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.
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.
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.

Sharepoint development deployment problems

I am getting the following error, when trying to deploy the visual studio generated Blank Sharepoint Project.
Error 1 Error occurred in deployment step 'Retract Solution': Cannot
connect to the SharePoint site: http://srv-sharepoint:35018/. Make
sure that this is a valid URL and the SharePoint site is running on
the local computer. If you moved this project to a new computer or if
the URL of the SharePoint site has changed since you created the
project, update the Site URL property of the project.
I set up a new application so have these 3 now: (Name, URL, Port)
SharePoint - 80 http://srv-sharepoint/ 80
SharePoint Central Administration v4 http://srv-sharepoint:32152/ 32152
SharePoint - Test http://srv-sharepoint:35018/ 35018
Its all on the server. And my project URL is http://srv-sharepoint:35018/
When I changed it to the admin port, it "ran" but just loaded up the admin panel.
What Am I doing wrong?
Add the current user to the web content database with owner role (more).
Have you setup the hostname ("srv-sharepoint") in your network's DNS or your machines hosts-file?
To setup your local development environment to use the "srv-sharepoint" host name, you need to add the host name to your development machine's hosts file.
The file is located at "C:\Windows\System32\drivers\etc\hosts" and you need to add an entry like this "127.0.0.1 srv-sharepoint". Note that this requires administrative privileges.
You may have to disable the loopback check as well, nut I honestly can't remember if that is necessary. See this link.
1.Check the web url in properties of the solution is valid.
(or)
2. Confirm the status of "Sharepoint timer service" is active/running.
(or)
3. It may due to the error occurred in previous deployment process of the same solution. So go to the central admin --> System Settings --> Manage Farm Solutions. Find out the solution, open it and retract the solution manually. Once retraction is completed, remove it. Then try again to deploy it using your IDE, visual studio, as administrator.
Your site url may be incorrect in solution, check it as below.
1) select the project, hit f4, properties of solution will open.
2) check the deployment url in project properties.
3) update the url as per the local url.
4) save, rebuild and deploy.
It should work.

How to get a Web Service to use a Fixed Port Number When Using the Visual Studio Development Server?

I have an asp.net website and a windows form application.
My Webservice's Location is : http://localhost:12312/MyWebSiteFolder/WSFile.asmx
Problem is : the port number keeps changing, if I reopen the solution, its going to change to something else:
http://localhost:11122/MyWebSiteFolder/WSFile.asmx
Is there a way so I won't have to update the location of the file in my windows form application everytime I reopen the website's solution?
(assuming Visual Studio 2010)
Under the Web tab of the properties for the project, change the "Auto-assign Port" option to "Specific port" and enter the port you want to always use.
Alternately, if possible, you can choose the option to use your local IIS server.
Update:
If you're using a "Web Site" project instead of "Web Application," the setting is located in the properties window of the project instead of the properties dialog. Note the "Use dynamic ports" option here:
How does your web application look on the Solution explorer - does it show
<drive>:\<some directory>
or
does it show the name of your web application with no path.
or
does it show http:/// <something>
In case 1 you should be able to see properties. But you wont get it for the rest

Unable to connect to ASP.Net Development Server issue

I am debugging codeplex simple project. I am using
VSTS 2008
C#
Windows Vista x86 Enterprise.
I have not modified any code of this codeplex project, and just press F5 to run VideoPlayerWeb project.
The current issue I met with is error message --
Unable to connect to ASP.Net Development Server.
Here is my screen snapshots when clicking F5. Any ideas what is wrong?
I had this problem with VS 2010, and it was as simple as terminating the "WebDev.WebServer40.EXE" process. Although the icon was no longer showing in the system tray, the process was still running.
Could be a number of things...try these (check the last one first)...
Disable IPv6
Make sure there isnt an edit in the
hosts file for localhost
Check firewall/virus settings to allow connections to/from
devenv.exe
If you can preview in the browser
make sure the URL in the browser uses
the same port number as the port
number shown in the ASP.NET dev
server taskbar icon.
Try setting a fixed, predefined port
in project properties
I got these from a couple of forums elsewhere, hopefully they can help. Good luck. Let us know what works and some more about your environment (firewall, anti virus etc) can help as well.
Under project settings, try specifying a different port like 64773 for example. I have encountered this issue many times and it has always worked for me.
It cause the already that project port server is running in the current thread. You need to end process using task manager.
Follow below step:
Pres Ctrl+Alt+Delete (Task Manager)
find the asp.net server like
WebDev.WebServer40.exe for VS2010
and press end process.
Now u continue with vs2010 run
button
I went to the project file and changed the development server port to 1504. Well 1504 worked on another project for me, so I went with that. Hope this helps.
I have tried all of the above solutions and others from other websites too but with no luck.
What worked for me, was to rename or delete the applicationhost file:
C:\Users\User\Documents\IISExpress\config\applicationhost < rename or delete.
That is very odd! I hate to suggest something as simple as restarting Visual Studio...but that is what sounds like the best first place to start. Also, check your project settings. As you said that you just downloaded this and tried to run it...perhaps the solution/project is not set up to use the Casini server that is shipped with Visual Studio?
Here are the steps
'Website' Menu in your visual studio ide.
select 'Start Options'
enable 'Use Custom Server' radio button.
Enter any URL you desire similar to 'http://localhost:8010/MyApp'
Note1: you can use any port number not only '8010' but not designated port numbers like 8080(tcpip),25(smtp),21(ftp) etc.,
Note2: you can use any name not only 'MyApp'
This solution works for sure unless your WebDev.Webserver.exe is physically corrupted.
Error
1) Unable to connect Asp.net development server ?
Answer: No way find for that error
Try 1)
Step 1: Select the “Tools->External Tools” menu option in VS or Visual Web Developer. This will allow you to configure and add new menu items to your Tools menu.
Step 2: Click the “Add” button to add a new external tool menu item. Name it “WebServer on Port 8010” (or anything else you want).
Step 3: For the “Command” textbox setting enter this value: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\WebD ev.WebServer.EXE (note: this points to the
web-server that VS usually automatically runs).
Step 4: For the “Arguments” textbox setting enter this value: /port:8010 /path:$(ProjectDir) (or any port you like)
Step 5: Select the “Use Output Window” checkbox (this will prevent the command-shell window from popping up.
Once you hit apply and ok you will now have a new menu item in your “Tools” menu called “WebServer on Port 8010”. You can now select any web project in your solution
and then choose this menu option to launch a web-server that has a root site on port 8010 (or whatever other port you want) for the project.
You can then connect to this site in a browser by simply saying http://localhost:8010/. All root based references will work fine.
Step 6: The last step is to configure your web project to automatically reference this web-server when you run or debug a site instead of launching the built-in
web-server itself. To-do this, select your web-project in the solution explorer, right click and select “property pages”. Select the “start options” setting on the left, and
under server change the radio button value from the default (which is use built-in webserver) to instead be “Use custom server”. Then set the Base URL value to be:
http://localhost:8010/
Obviously I don't know if this is the problem you had but definitely it is something similar, essentially the problem should be that the same port used by your
Development Server is not available because it is already used by another web server.
Try 2)
Here are the steps
1. 'Website' Menu in your visual studio ide.
2. select 'Start Options'
3. enable 'Use Custom Server' radio button.
4. Enter any URL you desire similar to 'http://localhost:8010/MyApp'
Note1: you can use any port number not only '8010' but not designated port numbers like 8080(tcpip),25(smtp),21(ftp) etc.,
Note2: you can use any name not only 'MyApp'
This solution works for sure unless your WebDev.Webserver.exe is physically corrupted.
Both of not worked after that Windows repair option remain
My solution was to turn off Internet Connection Sharing on my wireless adapter, after which it immediately worked. I made no other change. I suspect ICS's DHCP server was interfering.
Try commenting out the following line, if it exists, in your hosts file (%windir%\System32\drivers\etc\hosts):
::1 localhost
This worked for me using Visual Studio 2008 SP1 on Vista Ultimate x64 SP2.
I got this problem a couple of times and done different things to fix it. When I got it this time all I did to stop getting "unable to connect to asp..." error, was rename the web app folder directory from xpCal to xpCal2. I also tried moving the web app directory to a different directory from C:users\<me>\desktop\ to C:\users\<me>\desktop\new folder and it also worked.
I don't know why it worked, does VS 2010 keep information about web apps seperate from web apps folder.
In my case, when I had the ASP.NET Development Server crash, one thing that worked was to change the port for the project.
I suspect what happened was when the web server crashed it did not release a lock on the port. Even though it was not running in Task Manager, something was blocking a new instance of the web server from starting again on the original port. Changing the port was a decent enough work around. I could have rebooted, but who has time for that, right?
Details: Windows 7 x64, VS2010, .NET Framework 4.0, ASP.NET web site using the built in web server to VS2010.
BTW, I would be a little cautious with replacing the WebDev.WebServerServer.EXE as suggested in other posts. If that file has been corrupted then you have bigger problems with your OS.
hi
Just change the asp.netweb development server port from automatic to a specific port
e.g 8010
That's what worked for me
1) not reflecting HttpContext in class file ?
Answer:-Most of the time when using this syntax in class file is not working
we have to add reference then it work in class file
example using system.web write this syntax in class file
System.Web.HttpContext(HttpContext is not reflecting )
after that i add refrence system web than it reflect
None of the above solutions worked for me, but I did find one that worked: opening up the Administrative Tools/Services window and stopping the "WebClient" service. It's something of a pain to have to disable it when trying to work with my code, but it's easier than the logging off and back on I used to have to do.
--Problem Definition
------ whenever we debug our project (either by pressing ctrl+f5 or only f5) the first .exe which is called by VS is called WebDev.WebServer.EXE which got corrupted may be n number of reasons
--Solution
------ We need to replace this file
------Step 1 ---
go location C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0
You will find this file
-------Step 2 ---
download WebDev.WebServer.rar file from
http://www.2shared.com/file/11532086/a7f9858a/WebDevWebServer.html
-------Step 3 ---
NOTE : You will need password for extraction this downloaded .rar file
Password : optimusprime
------ Step 4 ---
Copy the downloaded WebDev.WebServer.EXE file and replace in this below path
"C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0
"
--------step 5------
run the program
Go to Run >> type >> cmd >> type
taskkill /IM webdev.webserver20.exe
and then try to re run the program
In my case I was using Windows 8 and Windows Firewall was blocking WebDev.WebServer.EXE
So I went to the settings of Windows Firewall > Allow an app through Windows Firewall > Add new
and browse to C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\11.0
Then select WebDev.WebServer to allow.
For some poor souls out there starting using TypeMock on ASP.NET unit tests like me, you need to disable it in Visual Studio to avoid this error: In Tools->Add-in Manager, untick the boxes for TypeMock Isolator. I guess you need to switch this back on for your unit tests.

Categories

Resources