-
I recently got fed up with an issue with the extremely lame Actiontec router that is build into every Qwest DSL modem. The issue basically has to do with how the NAT port forwarding was being performed. Packets sent to my external IP address from inside the local LAN were being dropped instead of forwarded. Since I host several services on a server inside my home network, and I have a laptop that is regularly connected inside and outside my home network this was a source of much frustration.
My initial workaround was to set up an internal DNS server. Using the Internet Software Consortium's BIND dns server, I created hard coded dns entries for my external domain name, so that my connections would go straight to my server's LAN IP rather than the public IP. All I had to do was configure my router to use my DNS server as the primary when clients requested one via DHCP. Unfortunately, after making this change, rebooting the router, running ipconfig /release and ipconfig /renew; low and behold, my client doesn't get the right DNS server (curse you Actiontec, curse you all to hell).
So then next step became setting up an alternate DHCP server that I could configure properly. Unfortunately my "server" runs Windows Vista Ultimate, and after doing some research online I concluded that unless you're running Linux/Unix/BSD, or Windows Server, your only choice is to use Internet Connection Sharing, which doesn't really meet my needs since it isn't very configurable, and it sets the box up as an internet gateway, which I don't want it to be. I considered using cygwin to build ISC DHCP, but I didn't really want to go to the trouble of running cygwin just so I could have a DHCP server. Finaly I decided, what the hell, there are only four different messages making up the critical piece of the DHCP protocol, surely I can implement this in less time than it's taken me to get this far. Five long nights later, as a sit writing this post, my DHCP server is up and running on my home network.
Writing it was an interesting experience. It was the first UDP socket application I'd written (I'd only written TCP apps before). The Wikipedia article was a huge help, and I'm indebted to the contributors who took the time to digram the message structures and sequences in a much more readable way than the RFCs. The did he final debugging by sniffing the traffic between a PC and my router during a DHCP exchange, which led me to discover that "network byte order" is big endian, not little endian like windows PCs, and that the "magic number" used to indicate the start of the options section is listed incorrectly on wikipedia (something I hope to remedy).
Anyway, I've created a community WinDhcp project on Codeplex, so if you want to see the source code, download the binaries, or contribute new code/bug fixes, please check it out.
-
A while back, when I was first doing WCF development I ran into the following exception:
AddressAccessDeniedException: HTTP could not register URL http://+:8080/<…>. Your process does not have access rights to this namespace.
The exception message included a link to an MSDN article that explained the concept of HTTP Namespace Reservations. Unfortunately the page suggests using an outdated, and not very user friendly tool called HttpCfg.exe to set up the namespace reservations. Even more unfortunate is the fact that this tool requires the user to enter a Security Descriptor Definition Language (SDDL) string by hand. Now, while I do enjoy the fact that I can now consider myself a member of the relatively small club of people that can read and write SDDL strings, this was not something I was especially excited about taking time away from the project at hand to do. Unfortunately search for help on the internet yielded more hurt than help.
What Not To Do
Upon performing my internet search, I ran straight into Mark Michaelis' post Windows Communication Foundation with Windows Vista and UAC. Now, generally speaking, I like Mark a lot, and he post a lot of good stuff on his blog. However, I am ethically opposed to what he is suggesting in his blog. Adding a manifest to your app to force elevation in Windows Vista is absolutely not what you should do! If you have a web serivce that has to run as Administrator then you are doing something wrong. In fact I hope you aren't even running as an Administrator account when you're developing (although aparently the Visual Studio team doesn't agree with me).
What To Do
Option 1: If you're on Windows Vista, you can use netsh. Nicholas Allen has details on his blog, as does Kenny Wolf.
Option 2: If you're not on Vista, or you want to set permissions as part of the setup process, take a look at the source code Keith Brown has posted on his blog.
Option 3: If you want a GUI based on C# code similar to that on Keith's blog, with a more flexible SDDL object model, then check out my tool, HttpNamespaceManager.
HttpNamespaceManager
This is not an official Microsoft tool, and should be considered sample code (see disclaimer below).
HttpNamespaceManager is available as either source code or an executable (both are in the attached zip file). It is licensed under the creative commons attribution license and is free to use, modify, and redistribute for commercial or non-commercial purposes. The project is divided into an API for managing HTTP Namespaces, including an object model for ACLs and Security Descriptors, and a UI with automatic elevation in Windows Vista for operations that require administrative privledge.
Requires .Net Framework 3.0 to run. Visual Studio 2005 & .Net Framework 3.0 to build.

This screen shot shows the start page of the Http Namespace Manager. All of the actions (Add/Edit/Remove) require elevation. Double clicking an item is the same as clicking the Edit button. The Remove button removes the entry permanently and without confirmation, so use caution.

When the Add button is clicked an input box is displayed in which the HTTP Namespace URL should be entered.

When the Edit button is clicked the following dialog is displayed. You must select a user or group in the top half of the form in order to set the permissions for it.
Disclaimer
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
[Updated: Fixed typo, "microformats are created on a whim" should have been "microformats are not created on a whim"]
Attended a really interesting talk about Microformats from Tantek Çelik of technorati.
I knew a little bit about microformats going in, so before I go into his presentation, let me fill my readers in. Microformats are a way of adding semantic information about data contained in an existing format (XHTML). XHTML already contains a mechanism for separating semantic information from presentation information, that is, CSS. The issue is that the inherent semantics in XHTML are all around document structure (i.e. this is a paragraph, this is a list, this is a table). However, the same mechanism used to create classes of tags that can be styled uniformly using CSS, can be used to attach a semantic meaning to a tag for data processing, a la, the "class" attribute. By using well defined HTML classes for tags that contain structured data, a page can contain data that is simultaneously human readable and machine readable. For a more thorough, and probably more accurate description of what microformats are check out the microformats.org wiki.
Here are a couple of interesting take aways from Tantek's presentations (the slides are available here):
- Microformats can't solve all your data format problems, but when data is already being represented in similar, human readable, semantically weak ways across the internet, microformats can be applied to make the data consistent, reusable, and searchable.
- "Microformats value the 80-20 solution. It is better to solve 80% of the problem with a simple solution that people can implement quickly, than to solve 100% of the problem with a complex solution." Paraphrased, check the video for the verbatim quote.
- The fact that the machine readable data is the human readable data ensures that the data gets human checked, so it is more likely to be accurate and up to date. For example, if I put vcard file on my blog, I might forget to update it when I change my profile, but if my profile is my vcard (using the hcard microformat) then it will be in sync by definition.
- Microformats are all about the community, the community collaborates and iterates on them. This ensures that microformats meet the community’s needs and no more. There isn't some standards body going off the tracks trying to create something monolithic.
- New microformats are not created on a whim, reuse is better, and when they are created, they are based closely on the specific problem space.
One of the microformats that interests me a lot right now is the hTodo format which is similar to the hCalendar format in that it is derived from the iCalendar spec, but it is for todo list items or tasks. This one is still in development, so it will be interesting to see where it goes, and possibly participate in the process.
-
Keynote video is up! (it says its a live stream, but its working as a non-live stream for me now)
Just got out of the MIX 07 Keynote w/ Ray Ozzie and Scott Guthrie. The big announcement was the cross platform .Net framework that will ship with silverlight. Keith Smith has a good write up over on his blog.
However, the biggest news for me in the announcements was what Wayne Smith let slip about the next versions of Expression Design and Expression Blend (his segment starts at time code: 00:44:00). The next versions of these products, which will have prerelease versions available soon (or now in the case of Blend). After Wayne demoes the Expressions Media Encoder, a tool for preparing video for web distribution, impressive in its own rite, he shows off the new versions of Design and Blend which feature built in support for Silverlight. This is pretty cool stuff, check it out.
For an overview of the release schedule for all this stuff, check out time code 2:06:00. But I'll give you a hint, there is a ton of stuff available today: Expresions Studio 1.0, Silverlight 1.0 Beta w/ GoLive license, and previews of v.Next Expressions stuff.
At the end of the keynote Michael Arrington of TechCrunch grilled Ray & Scott pretty hard on Microsofts move into the Web design space, a space currently squarely controlled by Adobe. I think Ray skirted the question about Adobe competition, but he and Scott made two things clear 1) choice is good for the marketplace, and Silverlight gives developers a new choice in developing rich browser applications, and 2) Microsofts believes in "software plus services" meaning, harness the hardware to create a great user experience one the form factors you target, and enable useful customer scenarios by hooking that client software into services. Check the interview out at time code 2:08:00.
-
I'm at the MIX 07 conference this week. I'll be attending sessions, meeting customers, and talking to people about Microsoft's services platform (not on stage). And I'll be blogging about all of it here! So stay tuned.
-
[Update: The issues describe here have been fixed in SP1 ov Visual Studio. Please install SP1 before installing XNA Game Studio]
Disclaimer: At the time of the writing of this post Microsoft does not support running XNA Game Studio on Windows Vista. There are plans to support Vista when it is publicly available early next year. For more information on support check out the XNA Team Blog. This post is by no means a gauranty that XNA Game Studio will work on Windows Vista, and this posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified here.
Note: My experience was on WIndows Vista RTM. If you are on a pre-release version of Vista your mileage may vary.
I recently decided to give XNA Game Studios a whirl, and despite the fact that it is not supported, decided to install it on Vista. Visual Studio C# Express installed along side of my Visual Studio for Team System installation without problems. However, when I went to install XNA Game Studio, the installer failed and rolled back because "Visual Studio C# Express had stopped working." The log file was unhelpful and contained only the following details:
Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action RegisterWithCSExpress, location: C:\, command: "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\VCSExpress.exe" /installvstemplates
So, I said to my self: "Self, I can probably install those templates manually later, there's no need for the installer to fail because VCSExpress is crashing." Perhaps not the best judgement since this crash demonstrates the inherent instability in my environment, but I decided to proceed anyway.
Having already installed the Windows SDK, I installed the Orca.msi located in the SDKs bin directory (Orca is a tool for analyzing and modifying MSI files). I was then able to open up the XNA msi in Orca. I quickly noticed the "RegisterWithCSExpress" action in the ActionText and CustomAction sections. After dropping both these rows from the msi I was able to run the installer successfully. I ran the VCSExpress.exe /installvstemplates command line manually to see if I could get any output regarding the crash, but I didn't get any and it crashed as expected. However, upon running VCSExpress normally I found that the templates had been installed successfully. Considering I've already had another crash when closing VCExpress, my guess is that the crash is happening as its shutting down and not really having any adverse effects.
I haven't actually created anything with it, although I did verify that the a default XBox Game project builds successfully, so no promises about it actually working, but at least it installs.
Cheers,
-Paul