How to disable WCF Test Client - VS 2012 - wcf

I have a new WCF Service Application, when I hit F5 to debug, the WCF Test Client always comes up, but I would like to disable it since I am using soapUI to test instead.
I have tried the answer here - https://stackoverflow.com/a/8441887/903056 but this XML node is no longer in the project file for VS 2012. I have tried several other things myself as well, such as changing default start page and trying to force debug to start a browser session instead.

This is realy frustrated but you can try one of the followings to disable the WCF test client:
1.Open the requested project properties and select the Web tab. Select
the Current Page radio button (I believe that the Specific Page
button is selected), Save the project and run(F5).
2.You can modified the prject XML (.csproj) file and add
<EnableWcfTestClientForSVCDefaultValue>False</EnableWcfTestClientForSVCDefaultValue>
attribute to <WebProjectProperties> node. That should be done by the
followings:
2.1 Unload the requested project (right click -> Unload Project).
2.2 Edit <ProjectName>.csproj (right click again on the project)
2.3 Look for WebProjectProperties node and add <EnableWcfTestClientForSVCDefaultValue>False</EnableWcfTestClientForSVCDefaultValue> to it.
2.4 Reload the poject.
I hope you will find that unswer helpfull..

A simple option that works for me (at least in Visual Studio 2012 Update 4):
Open the WCF project properties and go to the Web section. Set the Start Action setting to Don't open a page. Wait for a request from an external application.
After choosing that option I no longer see the WCF Test Client.
I personally usually choose this start action anyway, since I much prefer hitting F5 in my browser than having yet another tab opened each time I hit F5 in VS.

I found a reasonable work around. All I did was add an empty html page to the project, then right clicked on the html file in Solution Explorer and chose Set As Start Page. A debug session starts but it doesn't go to the WCF TestClient. Not elegant but works.

Old thread but found it while I was suffering the same frustration with VS2013. If you run the project (F5) with the (yourProject)\svc.cs file open in the VS editor then the WCF Client starts. If you hit F5 with any other file as the selected and focused file in the VS editor then IIS and the normal first web page starts.
Very simple when one knows.

I had a similar problem, and found this to be caused by the default Start Options under
> Solution Properties
> Debug
>Start Options
>Command line arguemnts:
it was listing a command line argument of /client:"WcfTestClient.exe" which was launching the test client. Simply removing this argument solved my problem.

No need to extra thing just do thing below.
Tools-->Option -->project and solution-->Build and Run and finally
check Only startup project and Dependencies on Run

Related

browser shows a blank screen when an asp.net core mvc application is run

I have created an asp.net core mvc web application in visual studio 2019 professional edition. After a successful build when I run the application, I am getting a blank screen in the browser. It is not showing the contents of the index page.
I checked the iis by typing inetmgr in the command window. It is opening up the iis Window. I also cross-checked in the browser window by typing http://localhost/. I am able to get the welcome page in IIS.
I don't know what's the issue here. Any valuable help is appreciated.
Please find the screenshot below.
When I faced a similar issue, it was due to the Web.config file, when the run httpRuntime was set to an incorrect target framework. Maybe remove the targetFramework parameter and see if the auto resolver resolves it.

How To Debug Web API Project From MVC Project In Another Solution

I have a MVC project solution and a separate API project solution (because it is used by different other solutions).
During debugging is it possible to hit the API solution code on debugging?
Both solutions are obviously running, giving correct data and results, the issue is that I am unable to hit the API project code during debugging - the debugger skips over the API and hits only the main solution.
EDIT
I realised that the API is a separate package and is referenced in the main solution as an assembly so I am not sure if it is possible to hit the breakpoint there at all? It's not used via Ajax.
yeah it is possible.
Assuming you use Visual Studio, start a second instance and attach it to the running process of the API. Put a breakpoint in your API and do whatever you need on the MVC side, to hit the correct endpoint in the API. Execution will stop and you can now debug in the second project as well.
This all depends how you run the API, you can even run the API from Visual Studio, using IIS Express in which case your URL will look something like http:\\localhost\api\sbla\bla:50310 for example.
Attaching works very well when the API is run outside of Visual Studio in proper IIS.
Make sure you tick the box which says "Show all processes" and look for a process called w3wp I think, this is all from memory.
You can't debug the API from the MVC project as they are both running under different processes
------ added after extra info ----
if the API stuff is inside a dll then make sure that dll is built in debug mode and then you can step into it. put a break point inside your MVC code right before you have a call which goes into the dll, then step into it and continue from there with normal debugging
Yes, it is possible.
Just open both your solutions in visual studio. Build the API project and add its dll to MVC project. Put break point on your API and run the API project. Now run your MVC project. Hit the API from your MVC project and break point will surely hit in API.

Does IntelliJ have an internal web server to serve static content of a web application?

Right now, the directory of my module is defined as an IIS virtual directory and IIS serves the files.
I was wondering whether IntelliJ has an internal web server, which can serve the files, without the need for any third party. Eclipse does.
UPDATE: built-in web server is available in the recent IntelliJ IDEA versions (starting from 13). You can find more details in the blog (yes, this feature first appeared in WebStorm).
IntelliJ IDEA has no this feature, you need to install and use any third-party web server that can serve the content from the project folders.
A built-in HTTP preview server will be part of Intellij IDEA 13 and is already available in the EAP: http://youtrack.jetbrains.com/issue/WEB-7148
"All existing actions — preview in browser (pop-up over html file or menu action or
shortcut), open in browser and create/debug html file action now open file on built-in web
server
http://localhost:63342/<project name>/<file path relative to source or content root>"
In other words, right-click on an HTML page and select "Debug" or "Open in browser", and IDEA 13+ will serve up that page via port 63342.
Here's another super simple option, install Python: http://www.python.org/getit/
Then open a shell prompt, navigate to your root web folder (e.g. public) and run python -m SimpleHTTPServer - This starts an HTTP Service on port 8000.
Further reading should you need it: http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python
I've got mine running on Windows 7 but the above article still applies.
Another option is is create a PHP project that, starting with v 5.4.0 of PHP includes a built in web server. This page explains it all ...
http://www.jetbrains.com/idea/webhelp/php-built-in-web-server.html
IntelliJ IDEA has a built-in web server that can be used to preview and debug your application. Just watch this YouTube video or follow the steps below.
Option 1
You need to add new 'JavaScript Debug' configuration:
Click Add Configuration... or Edit Configurations... in the Navigation bar
Click button in the toolbar or press Alt + Insert to create a new configuration
Select JavaScript Debug under the Templates node in the tree view of run configurations
Fill in Name, URL, Browser and click [OK] to save the configuration
Use http://localhost:63342/YOUR-PROJECT-NAME/index.html for URL
Now you can run the configuration:
Click run or debug button in the Navigation bar (or use Shift + F10 / Shift + F9 hotkeys).
Option 2
Running web page in browser without creating a configuration. Refer to the related IntelliJ IDEA Help article.
In the editor, open the HTML file. This HTML file does not necessarily have to be the one that implements the starting page of the application.
Do one of the following:
Choose View | Open in Browser on the main menu or press Alt+F2. Then select the desired browser from the pop-up menu.
Hover your mouse pointer over the code to show the browser icons bar: . Click the icon that indicates the desired browser.
Result
Google Chrome browser with a demo web page served by the Intelij IDEA's built-in webserver:
One simple way is to create a NodeJS / Express project in IntelliJ that is your web server. You can then use it to serve your static web pages and any other web content. The NodeJS web server is very small and runs fast - noticeably faster than IIS and Apache. Best of all you can just hit the Run button in IntelliJ or WebStorm to start it up.
By default, a NodeJS / Express project includes a public/ directory that you can use to contain your static pages that you can then view from http://localhost:3000/
This explains the steps required to enable NodeJS in IntelliJ and includes links to other Node resources:
http://www.jetbrains.com/idea/webhelp/node-js.html
If you feel the need, you can reconfigure your NodeJS server using server side Javscript code. You can add SSL support or almost any other server side features you care to dream up. Just add NodeJS modules using the npm (Node Package Manager) command line tool included with the install. NPM Registry https://npmjs.org/ indexes all the available modules.
You can configure IntelliJ to use a lot of different application containers, but each of them must be downloaded and installed separately. I currently have mine configured to serve via jetty, like eclipse, and also tomcat, tc-server, jboss, and node.js. It's pretty easy to set up.

How do I start a console application in one project from a web form in another project?

I have a website created in VS 2010 with .NET 4.0. There are multiple projects in the solution. In one of the projects I have a form that gives a user the option to run a console application that is in another project of the solution. (called update.exe)
I have tried just using
process.start(filepath + "update.exe")
but it doesn't seem to run.
It finds the file but then finishes immediately. I tried adding Console.readKey() to the console application so it would stay open after being called, but it was to no avail.
On top of this, I know that the console app isn't running as I have logs set up throughout the console's code and it never even seems to kick off.
Should I be calling the console app differently? (note: I am writing in VB.net)
Thanks!
Purely speculative here.. but my guess is that when the page finishes processing the process is terminated. Try having the page wait for the process to close.
My 'work-around' for a similar requirement is this:
Use the ASP page to create a CMD or BAT file on the server.
Create/write a service that 'watches' for the CMD/BAT file - and when it finds one, it runs it. The service can be written to start a process as a user.

WCF : How to disable WCF Test Client

I created a new WCF Application. It has a svc file & a code behind, When I try to debug (F5) then I see the following.
If svc file is open & press F5 then it opens the web browser
If code behind file is currently open & press F5 then WCF Test client opens.
Why there are different behavior? I do not want to use Test Client, how to disable it in the app so that it would not come again.
Atul Sureka
Open your project properties, go to the Debug tab, under start options you will see something like
/client:"WcfTestClient.exe"
delete that line.
For a WCF Service Application and WCF Workflow Service Application you need to modify the .csproj.user file. A full write up can be found here.
The key part is
<WebProjectProperties>
<EnableWcfTestClientForSVC>False</EnableWcfTestClientForSVC>
</WebProjectProperties>
I have been down this road MANY times over the years at different companies.... I forget and I found this page and while it is good advise for some, not helpful for me.
What DID fix this for a WCF application for me is this:
Note: Visual Studio 2013 FYI
1. Right click on the your WCF project and click Properties
2. Click on left "Web" link/tab --> Notice the Start Action Section
3. Check Radio Button "Specific page"
4. Enter your .svc example Service1.svc
5. Set project as startup and either hit F5 or right click and debug
6. Now the WCF Test Client launches (for me at least)
Hope this helps someone else.
Right Click WCF Project -> Select Properties -> Debug
In Debug, you can see the Command Line arguments specified as /client:"WcfTestClient.exe"
Removing this won't fire up the test client when you run the service.
Regards,
Venkatarajan Arthanari
for future view ... when i was in a svc file, and hit f5, it always start this utility ...
i try the param in the project file, don't work ...
then, in property, i change the setting in web, from Current page, to my default page :)
now i don't have this utility popping each time :)
To control the WCF Test Client auto-launch in Visual Studio 2015/2017 you can do the following:
Right-click the WCF Service Project in Solution Explorer, choose Properties, and click WCF Options tab. Clear the checkbox Start WCF Service Host when debugging another project in the same solution (that check box is enabled by default).
It is easier than that.
1.- Open Project properties.
2.- Debug tab
3.- Remove the "/client:"WcfTestClient.exe" appearing in the "comand line arguments" textbox.
4.- Done!
If you want to run the project in a browser,
Go to the properties of the project
Click -> Web
In the servers section, mention the iis (iisexpress, local IIS) and specify the URL "http://localhost:11111/"
this will take the program to the browser
To take it only to wcf test client,
follow the above steps, but the URL should point to the service.
http://localhost:11111/yourservice.svc .. will do.
Thank you
To disable WCF Service Test Client
In Solution Explorer right click on "Solution 'YourServiceName' "
and go to properties
In "Common Properties" select "startup project"
Enable "Current Selection" Radio button
Click "Apply"
Click "ok"
Now open which ever service you want to run, and hit F5. It will run the current service.