WCF WcfService1 Project Sometimes Doesn't Show Metadata Page 
Thursday, September 24, 2009, 11:57 AM - General, Computers, Development
I wasted a couple of hours today due to unexpected behaviors when running the default Windows Service project in Visual Studio 2008.

I wanted to test replacing the default contract interface (IService1.cs) and service (Service1.svc). So, here are the simple steps that made me crazy.

1. Create a new C# WCF Service Application project.



2. Run the project. You'll see the metadata page. Stop running.



3. Delete Service1.svc and IService1.cs.
4. Right-click the solution, Add > New Item, choose WCF Service. Name it Service1.
5. Select the Solution in the Solution Explorer. (that's your first clue.) Run the project. You'll see a directory listing.




You can accuse me of being dense, or not thinking, but when I saw this different behavior, I assumed the service wasn't working right. Now add these factors.

* Sometimes, if I edited web.config at all, the directory listing would appear.
* Sometimes, if I edited the .svc file (using Open With > Text Editor), the metadata page would appear.
* Sometimes, I'd get an error "Unable to start program 'http://localhost:3571/Service1.svc'"

I kept trying things, including folder/file compares of a new project to a non-working one. (It turns out this would have led me to the answer eventually).

Finally, searching on "debug mode wfc service "directory listing", I found this site, and this sentence:
At this point, if you browse to the location http://localhost/ExchangeService using Internet Explorer, you'll be able to see a directory listing (as long as the settings are like those in the previous figure). If you click on the Service.svc, you are then brought to the default help screen generated by System.ServiceModel.Activiation.HttpHandler for *.svc extensions.

I ran the project showing a directory listing, clicked on Service1.svc, and sure enough got the metadata page. Then, the light bulb went on.

The WCF Service Application project automatically sets the project's default page to Service1.svc. When I deleted that page, the project reset to Current Page.



So, what about those behaviors where sometimes it showed the metadata page? Well, when I was editing the web.config file, it would show the directory listing. When I was editing the Service1.svc file, it would show the metadata, because that was the current page.

What a fucking waste of my time.
  |  permalink   |  related link

President Obama's Speech to Students 
Monday, September 7, 2009, 02:19 PM - General, Social
I've now read the President's speech that he'll give tomorrow. I think you should, too. I think the vast majority of us are reasonable, even if we disagree. And that's why I say:

No reasonable American could object to what the President is saying to our students in this speech.
  |  permalink   |  related link

Grand Master George Anderson In Memorium 
Monday, August 24, 2009, 12:39 PM - General
Yesterday, Aug 23rd, I attended the memorial service for Kwanmukan Karate founder Grand Master George Anderson. You can learn more about Mr. Anderson here, but I'll just say briefly that his accomplishments in the martial arts, and as a person, were astonishing.

I met Mr. Anderson last year, and was honored to have a delightful discussion of violin with him. Before his career in karate, Mr. Anderson was already an accomplished violist, and he spoke with me not as a master and low-ranking student, but as two people sharing a love of music.

Here, in a form more lyrical, are my feelings about his passing.

Mr. Anderson's picture hangs in our dojo. One day, I said to sensei, "He reminds me of a bear." Sensei said, "He is!" A few weeks later, looking at the picture again, I said to sensei, "He reminds me of a tiger." Sensei said, "He is!"

Mr. Anderson had the body of a bear, and the heart of a tiger. The body contains the heart, and while we live the heart is struggling to break free, to share all that it is with everyone. Mr. Anderson's heart was freer than most, and he shared it with thousands.

Now his body is gone, and his heart is fully unleashed. The bear is dead, but the tiger roams the earth.

  |  permalink   |  related link

Oh. Just Get Rid of the Windows Registry. Right 
Sunday, August 9, 2009, 08:18 PM - General, Computers, Development
I just read a reasonably good review of Windows 7. But, there was one comment (stated better by John Dvorak) that showed a real non-understanding of computer software.
I still wish Windows 7 had dropped the System Registry, which slows down systems over time.

Right. Just drop it.

I agree that the registry is an obstacle, and I further agree that programs should be self-contained. But the notion of just "dropping" the registry is worse than ridiculous, it's inane.

Most software, and certainly almost all high-end, expensive, business-oriented software, relies on the registry to store dozens, even hundreds, of settings. Would the above article's authors ask Microsoft to render almost all of a user's software incompatible, and require almost all software makers to recode their applications to be Windows 7 compliant?

The registry can't just be dropped. That would be like dropping access to RAM, or dropping support for C++.

However, Microsoft might be able to ease programmers into a new direction.

Microsoft could change the API call so that it instead writes to an xml file located in the application's folder. This would mean that, on program un-installation, all registry entries would be removed along with the folder.

I admit, that would make me happy.
  |  permalink   |  related link

The Pizza Equation 
Friday, July 31, 2009, 11:09 AM - General, Humor
From my friend Doug:
Given the radius of a pizza "z", and the thickness of the pizza "a", the
volume can be calculated as pi*z*z*a.


  |  permalink   |  related link


Next