I'm pretty new to ASP.Net and I've been having troubles understanding something.
I made a web application project with a web service on my computer.
I made another web application project, who then consumed the WSDL from the web service on the first project and uses a function in it.
I ran each on a different VS2012 Instance and when both projects are running in then there is no problem and it works fine.
When i close the VS Instance with the Web Service project then I get a Coonnection Error which is also logical.
My question:
Is there a way to keep the server running without keeping visual studio open?
There is no ".exe" generated or anything so I don't know what to run in order to keep the "Server" running..
Additional question if you don't mind:
If I want to use this service from another computer on the same Network, will the "localhost:.....?WSDL" service reference still work or do I need another address?
Sorry for my lack of knowledge, I just couldn't find a good guide explaining about how to keep the server running anywhere.
Thank you, Mellor.
Host your web service in localhost
use the computername instead of localhost in WSDL URL when you add services/web reference in cleint applications
In some of the solutions we have ASP.NET/WCF web project and a test project. Some of the tests run against ASP.NET development web server using http://localhost:port/.... In VS2010 while the ASP.NET/WCF web project was being debugged, the test runner could run the tests and if there were any breakpoints in web project, the debugger would break the execution. This seems to have been disabled/removed in VS2012.
When the ASP.NET/WCF web project is debugged (launched by pressing F5 or via attach process), both the TEST->Run and TEST->Debug sub-menus are disabled. In VS2010 only Test->Debug sub-menus were disabled while Test->Run sub-menus were still enabled. We use this way to easily debug the services within the web project. Any way to get that behavior back or workaround?
Debugging While Running on ASP.NET Development Server doesn't seem to be applicable to VS2012 or at least I can't get it to work.
In VS2013 the situation is the same: the options for running / debugging tests are greyed out while the project is being run/debugged. This is a shame especially for projects like web API's where tests for calling the API via HTTP (as opposed to creating an instance of the Controller class and circumventing any network traffic) are very useful as they are closer to what the end users of the API will experience.
As a workaround, you can either open the same solution in a separate instance of VS, or create a separate solution with the same projects, specifically for testing. Debug in the first VS instance, run tests in the second one.
If you have a solution with WCF applications and tests calling them, you can debug the applications using the tests by calling Debug All Tests or Debug Selected Tests without a previous Start Debugging (F5).
Configure your solution to Multiple Startup Projects with None set in all actions and configure your WCF applications to the start action Don’t open a page. Wait for request. With this configuration the development web server starts if you select Debug All Tests or Debug Selected Tests.
Here is a workaround to debug a single unit test along with a web server. It relies on Debugging Multiple Processes (excludes MSVS Express):
Start web server (non-debug), note its process id (IIsExpress icon -> Show All Applications)
Place a breakpoint at first line in test
Start Debuging the Unit Test, wait for it to stop at the breakpoint.
Debug -> Attach To Process, enter web server process id
Both the test and server are running live in the debugger.
I ended up writing a quick addon. It turns out that like VS2012, VS2012 test runner can also run the tests when the web project is being debugged. It is just that menu options are disabled.
Try this:
Place a breakpoint in the first line of your unit test method.
Start debugging your unit test.
Once it hits the first line in your unit test, start a new instance of the other projects you need running.
This is not a pretty solution, but it works. Using Azure DevOps TFS Version Control, create a branch of your current project. Open the solution for your project, in the other branch, in another instance of Visual Studio at the same time as your main project is running in the first/original instance of Visual Studio. Then, run your web project in your first/main Visual Studio instance. Now, run your unit tests from the other instance of Visual Studio. Voila.
To keep them in sync, you can do Merges from one branch to the other.
I still ran into this on VS 2022.
If you have multiple projects you can run. Try to set the startup projects and set at least two of them. (solution->right click)
If two instances are running in debug mode, VS also allows you to start unit tests.
(I just started two aspnet api-s from my project)
I have Asp.Net solution that contains few WCF Service projects. Every time i run the application in debug mode, i can see that my services being hosted on ASP.Net Development Server. I just have single project in the start up.
Is there a way i can avoid this without removing these WCF Service projects from the solution?
To reproduce the situation. Create one ASP.Net project and add several WCF Service projects. Press F5 and you will see the WCF service projects being hosted on local development server.
This is what i have tried so far:
1) Project->Properties->Don't open a page. Wait for a request from an external application. I selected this option but it still hosts the service.
2) Unchecked ASP.NET in Debuggers selection. It still hosts the service.
Try right click the WCF project and go to the WCF Options tab.
Uncheck the Start WCF Service Host when debugging another project in same solution.
Is this what you are looking for:
I have a solution file containing multiple web applications and components. Mostly these web applications operate independently of one another, but I need to be able to response.redirect from one application to another. This works, and the new page runs, but I can't step into the code in the second web app and debug it.
I have both web applications set to "Always Start When Debugging" = True, with the first web app (the one that's redirecting) set as the startup web application. Does anyone know a trick that will let me step into the code in the second web application?
Open up a second instance of Visual Studio, then Ctrl+Alt+P (menu Tools > Attach to Process) then attach to the appropriate web server process (if you run under IIS this may be w3wp.exe or aspnet_wp IIRC, if you use the built in web server then attach to the process which lists the appropriate port for your project).
Optionally just run the second one and manually go to the first one in your browser by entering the appropriate address and trigger the redirect which you have verified is working.
Are both web applications running in the same process? What version of ASP.Net, IIS, and the .Net framework are you using? Those are my initial questions before I start giving other ideas.
i have a remote web site project in my sln that contains a wcf service and the server does not allow me to debug him...
when i run my client i get an error on the start that the server cannot be debugged..
how can i tell the vs to stop trying to debug the remote server?
If you have both a client and a server project in the same solution, then VS2008 is capable of debugging either one or both at the same time. There are two independent settings that control this.
Right-click on the solution and select "Set Startup Projects". This allows you to select any number of projects to start in the debugger when you press F5. Any project not in the startup list may very well be run anyway if it's a server, but will not be run in the VS2008 debugger - an important distinction.
Every ASMX and WCF service project has a property in its property window called "Always Start When Debugging" that controls whether VS2008 will auto-start it in the debugger when the client project is run.
I therefore suggest that you:
make sure that the server project is not set as one of the solution startup projects, and
make sure that the server project is not set to always start when debugging.