Friday, July 21, 2006

Quick .NET Web Reference Note

Apparently setting the URL property of a web service proxy class resets the Credentials property to the default. This means that if you're setting both, make sure to set URL and then Credentials. Intuitively I guess this would make sense if the pattern of use involved reusing the same proxy for calls to identical services in different locations. Given that in reality you usually create the proxy, optionally set properties like URL and Credentials, make some calls, and ditch the proxy, I don't know why that behavior exists.

Sunday, July 16, 2006

Http.sys and Rails

I made some good progress today on my .Net web server for Rails based on Http.sys. Ultimately I want it to support a pool of ruby interpretters, URL rewriting, and serving regular files (static and dynamic (aspx)) via http.sys. I already have the basic non-Ruby file serving in place through the magic of HttpRuntime.ProcessRequest. Right now I'm working on some simple wrapper classes to handle CGI. Once I have that done, I'll add URL rewriting so I can get Rails running. The last step is the process pool, so things actually run quickly.

Initially I'm going to try using a TCP socket as a control channel where the server can signal the child process to begin working and the child can tell the server when it's done. FastCGI looks like it actually multiplexes control information along with standard input and output over the TCP. Perhaps there's a good reason for that, but I'm going to start with the server writing to and reading from the child's standard in and out directly, orchestrated by the control channel.

My goals are both to learn about Rails from a development and solution architecture perspective and to simply the process of getting a production-ready Rails server setup on Windows. Rails can definitely have a place in a real enterprise architecture, but requiring clients with Windows servers to install and maintain apache (or lighttpd, etc.) in addition to IIS is a big hurdle. Having something based on http.sys should mitigate a lot of this (unified instrumentation, etc.).

Thursday, July 13, 2006

WinFX WF Beta 2 installation problems resolved

Over the course of messing with a new version of LINQ and other things, my WinFX Beta 2 install somehow got corrupted. When I tried to load the Workflow Foundation Designer I got the following error message:

Method 'ElementRemoved' in type 'TypeProviderHost' from assembly 'Microsoft.Workflow.VSDesigner, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.

I tried removing everything (Visual Studio Extensions for WF, Orcas CTP, Windows SDK, WinFX Runtime) and reinstalling and the same thing happened. Finally I was able to find this which solved my problem, even though the original question is about Beta 1. Basically, if you have 2 versions of EnvDTE80 in the GAC, remove the one with the lower Version (right click->Properties->Version tab).

Now everything is working and I can get back to preparing for my upcoming Devcare presentation.

Sunday, July 09, 2006

WEBrick Issues

I spent several hours today trying to get the most basic Rails site possible running on my laptop and only recently succeeded. Initially, something prevented remote Ruby Gem installs from working at all (gem install would just hang), so I had to chase down all the gem files and download them manually. When I finally got all that done, WEBRick just wouldn't respond to requests. Everything started ok, but when I hit http://localhost:3000/ in my browser I got "Waiting for..." and nothing else. I eventually had to kill the cmd.exe process to even get WEBrick to exit.

After lots of running in circles (even attempting to install mongrel which proved difficult since I couldn't find a win32-service.gem >= version 0.5.0 anywhere) I discovered the issue. A few weeks ago I did a half a day's work for a remote client that required secure VPN access. I had to install some software that worked with the little key generator they mailed me. After ruling out all sorts of firewall and connectivity problems I thought of this Juniper Networks stuff they had me install and once I removed it everything worked fine. Both WEBrick and my remote gem installs functioned perfectly. Whatever it was doing was enough to mess up Ruby's network code, without bothering my browser or any .NET apps I wrote.

Very odd.

Code Goes Here

public void Solve()
//code goes here