[WCF] Great tools in SDK

While browsing the WCF SDK I found two great tools:

  • Microsoft Service Configuration Editor

  • Microsoft Service Trace Viewer

The configuration editor helps you with the confguration files that you need with WCF. It simplyfies editing those files significantly. By using a tool you also avoid typing errors and it is very easy for example to switch diagnostic information on or off.

With the tracing switched on, you can use the trace viewer to browse the actual log files produced. This tool shows all messages flowing and additional information about the messages like what the body of the message was and the duration of the message. With this tool it is easier to find out what is going wrong if you run into an error or unexpected behavoir.

Both tools can be found in the following SDK folder C:Program FilesMicrosoft SDKsWindowsv6.0Bin or you can download it here.

WCF: HTTP 404 when hosted in IIS

While playing with WCF I ran into someting when I wanted to host the service in IIS.

I created a ‘service.svc’ in a folder, added a web.config, created a bin folder to put the assembly in, and added a website to that folder in IIS. According to the MSDN documentation and several blogposts, that was enough to host the WCF service in IIS.

But when I tried to browse the service, I received an HTTP 404 error.

In the release notes of the .NET 3.0 framework I found the following, which I thought should solve the problem because it exactly describes my problem.

2.7.4 May not be able to web host WCF services if a pre-RC1 version of WCF was previously installed

If you installed a previous version of the .NET Framework 3.0 while IIS was installed, when you upgrade to the RTM version of the .NET Framework 3.0 you may have difficulty accessing WCF services that are IIS hosted using .svc files. On computers running Windows Server 2003, accessing an .svc extension from the browser may return a “404: Page Not Found” error. On computers running Windows XP, the .svc content may be displayed as plain text.

This is due to an issue with WCF script map registrations in a previous release.   

To resolve this issue

There are three ways to work around this issue:

  1. Download the unsupported tool, CleanIISScriptMaps.exe from http://wcf.netfx3.com/files/folders/product_team/entry5648.aspx. Run the tool from a command console without any arguments.
  2. Uninstall and reinstall IIS or re-create your Web sites:

    1. Uninstall IIS and reinstall it so that the IIS Metabase is refreshed. Then run the WCF install tool manually to re-register the WCF scriptmaps:
      “%windir%Microsoft.NETFrameworkv3.0Windows Communication FoundationServiceModelReg.exe” /r /y

    2. If you are running Windows 2003 Server, you may be able to resolve the problem by deleting the “Default Web Site” and re-creating it.

  3. Install .svc manually as a temporary workaround:
    You can run the following command to install .svc mapping manually. However, this refreshes the IIS Metabase for existing sites. “%windir%Microsoft.NETFrameworkv3.0Windows Communication FoundationServiceModelReg.exe” /s:W3SVC

After trying all this, still a 404. 🙁
What actually caused the problem was the fact that I forgot to mark the website as a .NET 2.0 website instead of a 1.1 site which is the default.


Winforms: web browser control trouble

The last couple of days I had a big fight with the web browser control that ships with Visual Studio 2005 and the .NET framework 2.0.

I was using the ‘DocumentText’ property to display some HTML in the control, but for some dark reason it refused to do that. Instead it just contained <HTML></HTML> after assigning some HTML text to it. The strange thing was that everything worked fine after assigning HTML text to it the second time, but doing that the first time failed for some reason.

At the end I was very happy to find a blogpost with the solution: C# 2.0 WebBrowser control – bug in DocumentText?

  • Recent Posts
  • Recent Comments
  • Archives
  • Categories
  • Meta