Search

Recent comments

Categories

None


Contact the author

E-mail me Send mail

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

.NET HttpListener Class - Weak documentation on Prefix formats

Just thought I'd share this if someone else encounters the same problems I did trying to use this class.

The documentation for the .NET HttpListener class states that a Prefix host name + is similar to * without going into any further details.
There is actually a pretty big difference between the two.

There is also no mention of what happens when you specify an IP addresses as the host name (weak wildcard).

The full explanation is found in the MSDN documentation for the "HTTP Server API" under "UrlPrefix Strings".
See http://msdn2.microsoft.com/en-us/library/aa364698(VS.85).aspx

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Posted by jesper on Tuesday, March 25, 2008 5:48 PM
Permalink | Comments (0) | Post RSSRSS comment feed

intoDNS.com - a DNSreport.com alternative

DNSreport.com is a great tool for quickly analyzing a domain name registration and setup.
I have personally used it for many years, and still use it almost daily to check various domain names etc.

However about a year ago DNSreport.com became a paid service.
I perfectly understand that they need to finance their servers etc. and I am happy to pay the membership fee, especially since I use it as much as I do.
But a lot of people were unhappy about this because they didn't use the service enough to justify paying for a membership, and there weren't any good alternatives around.

Simple DNS Plus users have often asked us to provide a similar service or tool - or if we knew of any alternatives.
We do provide several free on-line DNS diagnostics tools - see http://www.simpledns.com/addons.aspx#online
But nothing as comprehensive as DNSreport.com.

Today I stumbled on a web-site called "intoDNS.com" which provides a free domain name report very similar to DNSreport.com.
The site is still in beta but looks very promising.

So if you can't justify paying for DNSreport.com - check out http://www.intoDNS.com

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Posted by jesper on Thursday, February 21, 2008 6:58 PM
Permalink | Comments (1) | Post RSSRSS comment feed

Smart Paster Add-In for VS2008

Just noticed that my favorite add-in for VS2005, Smart Paster by Alex Papadimoulis, is now also available for VS2008.

With this add-in you can paste text from the Windows clipboard into the Visual Studio source code editor formatted as a comment, quoted string, or string builder code just by right-clicking and selecting "Paste As..." from the pop-up menu:

This is just a fantastic time saver.

However the VS2008 version of the add-in only came as source code and had no instructions for installing it.
So for anyone else looking for this wonderful add-in, here's the compiled version:
SmartPaster2008bin.zip (27.13 kb)

To install it, un-zip above to:
Vista/2008: C:\Users\<user-name>\Documents\Visual Studio 2008\Addins
Earlier Windows: C:\Documents and Settings\All Users\Shared Documents\Visual Studio 2008\Addins

Then restart Visual Studio 2008 and update settings for the Add-In in the Tools menu / Add-In Manager.

Currently rated 4.5 by 2 people

  • Currently 4.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by jesper on Sunday, February 10, 2008 5:59 PM
Permalink | Comments (2) | Post RSSRSS comment feed

Microsoft's Software Licensing and Protection Services (SLPS) - Not for 64 bit

I am attending Microsoft's TechEd Developer conference in Barcelona this week (and having a great time).
One of the more interesting things (to me) that Microsoft is showcasing this year is a new product for ISVs called "Software Licensing and Protection Services" or "SLPS".
There has been 2 "breakout sessions" on SLPS, there are signs, flags, and posters advertising SLPS everywhere, and there are more "ask the experts" stands about SLPS than any other single topic here.

SLPS is a very interesting anti-cracking method involving a "unique virtual machine permutation" for each ISV or software title combined with a typical license activation server or service. For details see http://www.microsoft.com/slps

It seemed like a great product for a small ISV like us, and so I spent some time digging into this subject here at TechEd.
Microsoft sells SLPS through various resellers including PreEmptive - who combines this with their DotFuscator product.
PreEmptive also has a stand at the TechEd, and they offer a "challenge" where they add SLPS (and obfuscation) to an existing .NET executable to demonstrate how all this works.

PreEmptive gave me a very nice walk-through using one of the .NET based .EXE modules from our upcoming Simple DNS Plus v. 5.0.
The protected / license wrapped version worked very nicely during the demo on PreEmptive's computer, and following the demo they e-mailed me a copy of this to try on my own computer.
Unfortunately it did not work as well when I downloaded the file to my laptop later that evening - basically it just crashed.

This morning I attended another session about SLPS by Aidan T. Hughes (Development Manager for SLPS at Microsoft), and later in the day got a chance to talk to him personally about this - and show him the application crashing on my laptop.
It turns out that SLPS only works with 32 bit processes!
Since my laptop runs 64 bit Vista, and the .NET application was originally compiled for "Any CPU", it runs as a 64 bit process.
This worked just fine before SLPS was added. But with SLPS it crashes because it cannot load the 32-bit-only SLPS DLLs into the 64 bit process.
Quoting Aidan: "We haven't gotten many requests for 64 bit support, so this is not something we have tested a lot..."
Unfortunately he didn't give me much hope that this would be fixed in the near future - "we will look into this for future versions...".
His only suggestion was to re-compile the application for 32 bit (x86 CPUs).

Unfortunately that is a showstopper for us.
Many of our users have been asking about 64 bit for some time now.
All new CPUs from Intel and AMD are 64 bit capable (both companies have stands at TechEd and I checked with them both) and Microsoft's own flagship product Window Vista comes with both 32 and 64 bit versions in the same box.
So I am surprised that Microsoft would launch this new product without 64 bit support.

That said, I would like to thank the staff at PreEmptive and Microsoft's SLPS group here at TechEd for their great help and personal attention to this.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by jesper on Thursday, November 08, 2007 2:52 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Building Simple DNS Plus v. 5

We are just about ready to release the very first beta version of Simple DNS Plus v. 5.0.

That means that a lot of compiling, installer building, and testing is going on at the moment.
All in all, getting from source code to a complete "setup.exe" file involves 30+ steps of doing different things in different programs (compiling, obfuscating, packaging, signing, virus scanning, etc.) - all of which has to be repeated over and over as we correct bugs and fine tune everything.
Until yesterday this was a manual and painfully slow process.

Today I discovered "Visual Build Professional" from http://www.kinook.com

After playing with the trial version for only a few hours, I had our whole build process completely automated.
I just placed an order for the full version - this software program will save us so much time in the next critical beta testing period that it will pay for itself ($300) many many times over!

I know there are other automated build tools out there, but what really sold me on this one is that it has direct support for exactly the tools we use to build Simple DNS Plus v. 5.0:
- Visual Studio 2008 Beta 2 (http://www.microsoft.com/vstudio)
- Dotfuscator Professional Edition (http://www.preemptive.com)
- Advanced Installer (http://www.caphyon.com)
- Help & Manual (http://www.helpandmanual.com)

I was even able to include an automated a virus scan of each compiled .exe file and the final setup.exe via the command line tool that comes with Kaspersky Anti-Virus (http://www.kaspersky.com).

So now when we make a small change to the source code, we can then compile and package a new setup.exe file, and upload it to the web-server in just one step!!

The build process is of course only the final step - a number of other tools also play significant roles in creating Simple DNS Plus:

- SandDock (http://www.divelements.co.uk) - dockable/tabbed windows.
- dotTrace Profiler (http://www.jetbrains.com) - for profiling/optimizing.
- FogBugz (http://www.fogcreek.com) - for tracking bugs/ideas/suggestions.
- Axialis IconWorkshop (http://www.axialis.com) - for converting/creating Vista ready icons.
- Hexago / go6 client (http://www.go6.net) - for testing IPv6 features.
- SyncBackSE (http://www.2brightsparks.com) - for synchronizing folders and uploading websites.
- Mozy (http://www.mozy.com) - continuous remote backup of irreplaceable source files.
- Paint Shop Pro (http://www.corel.com) - my favorite imaging program.
- VMware Workstation (http://www.vmware.com) - for testing on different platforms.
- Reflector (http://www.aisto.com/roeder/dotnet) - for fine tuning .NET code.

We have tried many different tools in all these categories over the years, and I can highly recommend all of the above over any competitors that I know of.

For more on Simple DNS Plus v. 5.0 see http://www.simpledns.com/v50beta.aspx

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by jesper on Saturday, September 22, 2007 2:50 AM
Permalink | Comments (0) | Post RSSRSS comment feed

A smarter boot file for Simple DNS Plus v. 5

Several new features in Simple DNS Plus v. 5 require a new way to store the DNS zone list on disk.

Previous versions use a standard DNS "boot" file – a plain text file listing each zone line by line.
This format is very simple for anyone to read and update, which is why we have stuck with it this long.
Version 5 however needs to store additional information for each zone and update this much more frequently, making a different storage form necessary.

All the data from the "boot" file is actually cached in memory while Simple DNS Plus is running, so theoretically we could just read in all the data at startup, update the data in memory while running, and then save it all back to a file at shutdown. Only problem is if the computer shuts down unexpectedly (looses power), then the latest changes would not be recorded, leaving a mess.
So we need an efficient way to keep a continuously synchronized copy of the data on disk.

Using a full scale database system such as MySQL or Microsoft SQL Server would be overkill for this.

I spent a few days evaluating lightweight embedded database systems (see previous blog entry), but ultimately decided that this was too slow and added too much overhead and complexity as well.

The solution I eventually came up with was a simple proprietary file structure specifically shaped around the unique data of the DNS zone list with a few design ideas borrowed from xBase.
We’ll call it the "Simple DNS Plus Zone Database" file format – or ".sdpzdb" files.
Simple DNS Plus will store the file position of each record (zone item) in memory eliminating the need for database indexes, and making updates/deletes extremely efficient.

While this provides a lot of benefits, there is one major downside; since the new file format is binary, it can’t just be opened and edited with notepad like the old "boot" file.
We believe that was an important "feature", and so we will do what we can to make it easy to work with the new format as well.

For starters we have put together a small "Zone Database Viewer" application to quickly browse the data.
This can also export the data to the old "boot" file format or a CSV file.

And we plan on providing a .NET library to access the file as a standard "system.data.DataTable" object.

One remaining issue we have to deal with is concurrent updates to the database from different processes. Both the GUI record editor module (editrecs.exe) and the main server module (sdnsmain.exe) can update the zone list – potentially at the same time.
We can solve this either by using file locks, or possibly having all updates go through the main server module. The later would turn Simple DNS Plus into a simple database server, which may open up some other interesting possibilities…
We haven’t decided which way to go just yet. 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by jesper on Sunday, June 17, 2007 2:48 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Evaluating lightweight database systems

I spent the past few days evaluating different embedded database system for possible use in the upcoming Simple DNS Plus v. 5.

Simple DNS Plus v. 5 will be .NET based, so my first requirement was that the database system had a .NET API or data provider.
Ideally it should run on both 32 and 64 bit Windows versions and under MONO on non-Windows systems (Linux, MacOS, Solaris, etc.).
And of course it should be fast and small as possible.

I looked at the following options:

1) Microsoft SQL Server Compact Edition (MS SQL CE).
(http://www.microsoft.com/sql/editions/compact/default.mspx)

At first this looked like the obvious choice since it is practically part of the Visual Studio toolbox (or will be in Visual Studio "Orcas").
However, at this time there is no 64 bit version, which would also prevent Simple DNS Plus from getting certified for Windows Vista (see http://channel9.msdn.com/ShowPost.aspx?PostID=312747).
And from what little information I can find, Microsoft has not committed to a 64 bit version in the "Orcas" timeframe either
(see http://blogs.msdn.com/stevelasker/archive/2007/01/16/sql-server-compact-edition-3-1-released.aspx#1753365)

Of course being win32 code it probably doesn’t run on non-Windows systems.
2) VistaDB
(http://www.vistadb.net)

This database system is a 100% .NET managed code DLL which can be linked directly into another .NET assembly. So this is truly an "embedded" database system.
The same code runs on both 32 and 64 bit – and even on non-Windows systems (under MONO).
The downside is that this is rather slow compared to the other database systems (according to my own simple speed tests), and the documentation is not great.

3) SQLite
(http://www.sqlite.org and http://sqlite.phxsoftware.com)

This was significantly faster than both MS SQL CE and VistaDB.

For .NET development, this is available as a hybrid DLL containing both the native code SQLite engine and the .NET provider.
Because of the included native code, there are separate DLLs for win32, x64, Itanium, and .NET compact which makes the total distribution size significantly larger than the other database engines.

A potential issue is that it has no type safety. Anything can be stored in any column.

I imagine the hybrid DLLs cannot be used on non-Windows systems, but the SQLite engine itself is available for many operating systems and as C source code, so there is probably some way around that…

4) Codebase
(http://www.codebase.com)

About 10 years ago I used this database engine to build a larger invoicing system with VB3 16 bit.
It was VERY fast back then and still is today.
It uses xBase data files which explains the speed (very simple and efficient file layout), but also why the data file becomes very large (data fields are padded to maximum length).
It has a .NET API but is itself native code. I am not sure if it works under MONO.

5) Firebird
(http://www.firebirdsql.org)

I didn’t actually get around to testing this, but wanted to mention it because it looks like another good option.
It has a .NET data provider but is itself native code. I am not sure if it works under MONO.

And the winner is… none!

Basically they were all just overkill for what I needed.
Had I chosen one, it would have been either VistaDB because it best fit my requirements or SQLite because it was very fast.

Instead of a database I ended up using a "homemade" highly optimized proprietary file structure.

A quick comparison of inserting 150.000 random records (representing 150.000 DNS zones):

VistaDB:
2 minutes

MS SQL CE:
1 minute

SQLite:
25 seconds

"Homemade":  
1/3 second (yes, one third of one second)

And the resulting "homemade" file was significantly smaller than any of the database files.

Read more about the "homemade" file structure here...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by jesper on Sunday, June 17, 2007 2:40 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Documenting and packaging the new Simple DNS Plus API

We will be releasing a new Simple DNS Plus API for .NET and COM this coming week - watch our company blog/RSS for the announcement.

We were actually pretty close to releasing something very similar for COM about a year ago, but that project was eventually scrapped for several reasons.
Primarily we were stuck with the API documentation because this could not be automated, but around the same time we were also shifting our focus to the .NET platform and therefore knew that we would not maintain this project going forward anyway.

So this time around we wanted automated documentation from the beginning.
The solution turned out to be Microsoft's "Sandcastle" project (see http://www.sandcastledocs.com and https://blogs.msdn.com/sandcastle) along with SandcastleGUI (see http://www.inchl.nl/SandcastleGUI).
This combination makes it real simple to convert XML comments from .NET source code into a real .chm help file and matching web version.
Check out the (preliminary) API documentation at http://www.simpledns.com/apihelp
Sandcastle is still in beta but works pretty good already.

Then it came time to package the first alpha version of the new API.
We have been using InstallShield to build installers in the past, but were not real happy with it and therefore haven't upgraded it for a while.
I thought we were going to be using the deployment functions in Visual Studio 2005 which is much improved compared to earlier Microsoft offerings, but we still ran into some issues.
When distributing software over the Internet, I believe that this should be done with a single self-extracting, self-installing, and signed .exe file.
Unfortunately there is still no way to create such an installer in VS2005.
Luckily the Windows operating system conveniently ships with "IExpress" which can package the install files from VS2005 just like I wanted, and the resulting .exe file can then be signed manually with the SDK tools.
BUT - it turns out that packages created with IExpress on Windows Vista do not work on Windows 2000, and packages created with IExpress on Window XP act weird on Windows Vista...

So it was time to look for alternatives - and I found a great one in "Advanced Installer Professional" (see http://www.advancedinstaller.com).
With this tool it is much simpler to configure the installer project, it can package everything into one .exe, and it can automatically sign it.
And I really like the way it automates downloading of prerequisites such as the .NET Framework.
I highly recommend it! 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by jesper on Saturday, February 03, 2007 2:37 AM
Permalink | Comments (0) | Post RSSRSS comment feed

How to connect to the IPv6 Internet?

All indications are that the Internet will move to IPv6 in a not so distant future.
All major operating systems now support the IPv6 protocol, including Linux, BSD, Solaris, and Windows (included with XP SP2 / Vista).

Our friends at www.dnsstuff.com recently started a free service at www.6gate.com to IPv6 enable web-sites running on IPv4 simply by adding a DNS AAAA-record.

Another thing that made me pay attention is that IPv6 is now enabled by default in Microsoft’s .NET Framework 2.0, and fully supported in Visual Studio 2005.
This, for me, finally makes it realistic to start developing for IPv6.

But then how does one actually connect to the IPv6 Internet to begin testing, experimenting, and playing with this?
My local ISP does not offer any IPv6 connectivity yet.
The Windows XP SP2 IPv6 implementation offers a "Teredo" function to tunnel traffic between IPv4 and IPv6. But this appears to require a "Teredo relay" somewhere on the IPv4 Internet, of which I cannot find any...

The 6gate.com service utilizes the services of www.sixxs.net, so had a look at that site and tried out their "10 Easy Steps to IPv6".
This involved a rather complex and lengthy identification and setup process.
After this I had a tunnel to the IPv6 Internet - or at least so the AICCU software claimed.
But my local computer could still not ping any IPv6 addresses.
Unfortunately there were no more instructions beyond the 10 steps.
After randomly reading various FAQs I think that because my computer is behind a NAT router, I would also need to install a "TINC" tunnel driver.
This appeared to be some type of VPN NIC driver (similar to OpenVPN) but I could not find any instructions on how to get this to work with the AICCU software.
So I had to give up on this :-(

After a bit of Googling, I found another IPv6 tunnel system/service at www.hexago.com.

Fortunately this was a breeze to sign up for and setup, and I now have a fully functional IPv6 address and connection. I can ping other IPv6 addresses, and surf IPv6 web-sites etc.

So then it was time to play with Visual Studio 2005, and it didn’t take long before I was sending and receiving DNS packets over IPv6, just by changing a few Winsock parameters. Cool!

Look out for a new IPv6 and IDN enabled version of the Simple DNS Plus DNS Look Up tool soon...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by jesper on Friday, May 12, 2006 2:34 AM
Permalink | Comments (0) | Post RSSRSS comment feed