Debug WCF Service on remote calls - wcf

I would like to debug incoming requests to my service on remote calls (at least on calls from machines on the same network). What do I need to achieve this? As of now I can only debug local requests. Otherwise the breakpoints wont be hit.
I hosting my service on IIS.

It is possible to get a full Visual Studio Debugging experience in the setup you describe. Simply deploy your app to IIS and get it running. Then from within visual studio Choose Debug -> Attach To process. In this window be sure to tick "Show Processes from all users". After doing this click the refresh button. When that is done, locate the IIS process in question (w3wp.exe) in the task list and click attach.

To debug a WCF Service, you can add the following configuration in your web.config :
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\temp\WEBTraces.log" />
</listeners>
</source>
</sources>
</system.diagnostics>
You have to create a folder named temp in C:\.
It will log every request of your service in a XML file.
Hope it helps !

Related

How to make IE11 behave like IE8

My application works fine with IE8 but not in IE11. We are not in condition to make change in code as application code is huge.So i am using following code in the common top level jsp:-
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">
but still application view is not same as when we manually run the page in compatible mode.What i have notice is that when i manually run the page in compatible mode document mode is set to 5(Default) but when i am using meta tag document mode is still set to Edge.
Thanks
You can Forcefully Emulate IE11 to behave similar to IE8.Add the below lines of code to your web.config file
<httpProtocol>
<customHeaders>
<clear/>
<add name="X-UA-Compatible" value="IE=EmulateIE8"/>
</customHeaders>
</httpProtocol>

image resizing in azure not working when deployed locally

<resizer>
<plugins>
<add name="MvcRoutingShim" />
<add name="AzureReader2" connectionString="UseDevelopmentStorage=true" endpoint="http://127.0.0.1:10000/devstoreaccount1/" />
</plugins>
</resizer>
I am trying to implement image resizing in my Mvc4 application using "AzureReader2". I had installed all the nuget packages and modified webconfig file as above. It works fine when i tried to deploy on server. But locally it fails, it's says "The remote server returned an error: (400) Bad Request.".
Do any one faced the same issue, if so let me know the work around please.
The local storage emulator for Azure hasn't been updated. Microsoft is working on fixing this. This isn't related to ImageResizer.
http://blogs.msdn.com/b/windowsazurestorage/archive/2013/11/27/windows-azure-storage-release-introducing-cors-json-minute-metrics-and-more.aspx
"As mentioned above an updated Windows Azure Storage Emulator is expected to ship with full support of these new features in the next couple of months. Users attempting to develop against the current version of the Storage emulator will receive Bad Request errors as the protocol version (2013-08-15) is unsupported. Until then, users wanting to use the new features would need to develop and test against a Windows Azure Storage Account to leverage the 2013-08-15 REST version."

What's the difference between publishing and building an Mvc 4 app with respect to unsafe code?

I have an asp.net mvc 4 app that references a c# project which uses the unsafe keyword and this is allowed for in the project properties. The problem is when I publish the web app and I get the unsafe errors. In another post (Publish web application with unsafe code), someone says there is a difference between publishing and building and the app's web.config file needs to be edited.
I added in the following to the web.config file:
<configuration>
<!--Some other configuration code-->
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/unsafe" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</compilers>
</system.codedom>
<!--Some other configuration code-->
</configuration>
But this didn't work (also didn't work for the other poster). Rather than restate his question, my question is:
Given there's a difference between publishing and building for unsafe code, how can I check if this web.config change is being picked up correctly?
In addition, I've using IIS8 Express. Is there additional configuration I need to do in IIS to allow unsafe code to be published perhaps?
Possibly relevant: Before referencing the unsafe code project I was able to build the web app and view the unpublished result in the browser by binding some url in IIS to that project. After referencing, I get an error when using the url. Running the debugger from visual studio is fine and so this makes me think that IIS is the culprit. I'm a novice though and really am grasping for ideas. Any help much appreciated.
(Windows 8, VS2012)

FontAwesome on windows Phone 8

I am having trouble getting FontAwesome icons to show on Windows Phone 8.
Phone (HTC 8X): OK on the dev box (http), but not on the QA server (https)
Surface RT, Pro, desktop: OK on both servers
All devices use IE10. Both environments (Dev and QA) use IIS7. It seems that IE10 phone is somehow different from IE10 tablet/desktop in its treatment of downloadable fonts.
Has anyone else experienced this?
It was due to a missing MIME type. I was wrong about both environments using IIS7; The QA server uses IIS6. We added application/x-font-woff to the IIS configuration, and that fixed it.
UPDATE:
Add this to your Web.config to associate .woff files with the correct MIME type, so the server will know what to do when such a file is requested:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
</staticContent>
</system.webServer>
</configuration>

Moving from IIS6 to IIS7.5 - Custom Handlers

I am moving a site from IIS6 on one server to IIS7.5 on another.
This site was not writen by me, and from what I can tell, they use custom handlers to get around the AJAX limitations of the day.
I copied the code from the old server to the new (pre-compieled) and everything works except the "AJAX" stuff. There are several calls in the code to ashx files. These calls return .js files. On the old server this works great. Does not work on the new server.
In the web.config file I found the following lines:
<httpHandlers>
<add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
</httpHandlers>
For some reason this is not working in IIS7.5
Any suggestions are welcome.
Thank you!
I suspect this could be down to the configuration of the application pool managed pipeline mode. You can easily confirm this by changing the Managed Pipeline Mode for the application pool the site runs under to Classic. If this works and you want to continue to run in Integrated mode then you will need to add a handlers section to the web.config. This is different from the httpHandlers information you noted above.
The new handlers section should be in the system.webServer section. I'm sorry I do not know the exact setting for the item you note but you will need to include the preCondition="integratedMode" if you wish to run in integrated mode.