How do I use Fiddler to listen to the asp.net development server (i.e. cassini)? - wcf

I am attempting to debug a (RESTful) WCF app using Fiddler. I run my project via VS IDE - which launches my app in the ASP.NET Development Server aka Cassini. I then launch Fiddler and in the Request Builder tab enter the following: "http://localhost:1066/GeneralService/sections/summary" with GET as the http method.
Fiddler responds with "[Fiddler] Connection to localhost failed.Exception Text: No connection could be made because the target machine actively refused it ::1:1066 "
Is there some way for me to debug an app running on Cassini?
Thanks,
Steve

One neat trick is just to add a period(.) after the word localhost. No other config neccesary.

Change the url to http://ipv4.fiddler:1066/GeneralService/sections/summary to enable fiddler to listen on localhost

You can use the integrated traffic monitor built into CassiniDev. It can be run stand-alone or as a direct drop-in replacement for VS 2008/2010 development servers.
alt text http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=cassinidev&DownloadId=123367
alt text http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=cassinidev&DownloadId=123366

Related

SignalR between VsCode dev containers using default bridge network

If I create two ASP Core web services in VsCode and implement a SignalR hub in one which is connected to by the other (Dotnet 5, SignalR client library 5.11). This works fine. I can push these services up to Azure and it still works fine.
If however I open these webservices locally in a VsCode dev container and configure them to connect using the default Docker bridge network and the default forwarded port, I get a Connection Refused exception on the HubConnection.StartAsync call.
Why is this and how do I fix it?
I've tried a few things, using the http and https ports, disabling SSL verification in the client service but nothing works so far. I think I need some information on why this isn't working in the first place before I have much chance of coming up with a solution.
The problem was that that Kestrel was still listening on the default network interface inside the Docker container and I needed to reconfigure it to listen on all interfaces for the connection to work.
So in launchsettings.json I needed to change applicationUrl from "https://localhost:5003;http://localhost:5002" to "https://0.0.0.0:5003;http://0.0.0.0:5002" and then everything worked pefectly.

how to configure IIS for mvc4 application?

I am new to mvc4 applications. I am trying to run an asp.net application in mvc4. I configured by right clicking on the project and setting the URL to local host under the web tag.
While running the application I found below error:
"Unable to launch IIS Express webserver, port 80 is in use"
I am also running SQL server on my computer possibly its using the port 80.
I tried to change the port number but it does not work.
I am using the administrator account.
How can I fix this problem?
You will need to determine who is using port 80.
I like using ActivePorts for this.

SignalR: Connection.Start().Wait() hangs the browser indefinitely

I am using ver 0.5.3 of SignalR assembly in my silverlight application. I use connection.Start().wait() to start the connection:
Some of my observations are, which are really strange:
I run the application (In-Browser) mode via Visual Studio and I am able to establish the connection with the SignalR hub
If I deploy the app in IIS and then try accessing the application using the IP address of the machine, the call to connection.start().wait() never returns. I checked the Fiddler and figured out that the call never goes to the SignalR hub
If I use the application in OOB mode (Out of Browser mode), application works without any issue.
My requirement is that it should work in in-Browser mode.
Can somebody throw some light, what could be the issue?
Thanks,
Alpee
It appears to me that you are running into Silverlight's cross-domain request restrictions when run in-browser. You can either host the silverlight application on the same domain that is running SignalR, or you could add a clientaccesspolicy.xml or crossdomain.xml file to the root of the domain running SignalR as suggested in the above link.

Unable to set WinInet proxy from WinForms application

I'm running windows 7 and IE9. I'm writing a winforms application (.net 4.0 & c#) that runs a proxy server (using TcpListener) on another thread.
Before I instantiate the main form i set the proxy using InternetSetOption and start the proxy server.
My proxy setting code is very similar to the one here: Set Proxy UserName and Password using Wininet in C#
then i browse to a site in IE, IE doesn't connect to my proxy server. also, IE tools --> internet options --> connection --> lan settings --> use a proxy server for your LAN checkbox is NOT checked. but when I run fiddler, this checkbox IS checked. this means fiddler is setting the proxy correctly, but I'm not. how does fiddler do that? i have gone thru' numerous blogs, MSDN articles on InternetSetOption in vain. any help is appreciated.
My proxy server code is very similar to the one here: Simple Http proxy using Sockets: Questions
I know my proxy server works because, when I go to IE tools --> internet options --> connection --> lan settings and explicitly set the proxy server to 127.0.0.1:9898 (thats where I run my proxy server), IE and all other browsers connect to my server.
The WinINET.cs file in this code download: http://code.msdn.microsoft.com/CSWebBrowserWithProxy-c8535715 has the core functionality to set the WinINET proxy. It gets a few minor details slightly wrong, but will work properly for most cases.

WCF client connection problem

I am consuming a web service in .NET application with WCF client.
The Endpoint's address of the service is over port 4338, and it is over HTTPS, secured with WS-Security standard.
So the address is something like :
https://[servername]:4338/[servicename]/
I was not able to communicate to the service with just running the application.
it gave me the following error :
Could not connect to [servername]:4338
TCP error code 10060: A connection
attempt failed because the connected
party did not properly respond after a
period of time, or established
connection failed because connected
host has failed to respond
[servername]:4338
But when I run Fiddler to investigate the http communication, the application start to work, and I will be able to communicate to the service.
As well, I want to add that I have a different service on the same web server that hosts the first service, and that second service's address is hosted on port 8080, and I am able to communicate with it with WCF client (without running Fiddler).
So, I googled and I found that it might be related to the proxy settings. Do you know what the problem is, and how can I solve it?
Thanks
Fiddler acts as an Internet proxy server. In general, any symptom of the form: "it works when I use Fiddler" means "it works when there's a (different) proxy server".
Check your proxy server settings. In particular, as empi suggested, try it in a browser. If it works there, it could be due to the fact that the browser has the proxy settings configured, and that you do not have them configured for WCF.
If you have proxy set in Internet Explorer, it may cause the problem. What happens when you open https://[servername]:4338/[servicename]/ in Internet Explorer?
Thanks empi for the reply.
I found the answer.
Actually in our company we have a proxy settings through "Automatic configuration script"
and depends on the web sites we are targeting internally, the script will point us to the proper proxy.
So, from the script I got the proper proxy address.
and in my .NET application I added this code
WebRequest.DefaultWebProxy = new WebProxy("http://xx.xx.xx.xx:8080");
and that fixed the problem
So WCF client was not detecting the setting of the automatic script.
and this is the reason it worked when I run Fiddler, because Fiddler listen to the http communication, and send it again through the settings.