« February 2004 | Main | April 2004 »

March 31, 2004

Delete 0.95 cookies when deploying 0.96 Dottext

The data stored in the Dottext cookie under 0.95 fails to parse under the current version of 0.96 (today’s source).

The symptom is a “The root element is missing” XML parsing error immediately on all pages.

The work-around is to delete the cookie. You can either use ToolsàInternet OptionsàDelete Cookies which will delete all your cookies, or ToolsàInternet OptionsàSettingsàView Files; the sort by Address and find the dottext cookie associated with your deployment web site and delete it.

 

Manually adding a user to the pre-release 0.96 Dottext schema

The current Dottext schema is adding user account and user role features which requires a little manual database updating:

1.      Add a record to the blog_GenericUsers table:

a.       UserName & Password, copy from blog_Config table.

b.      PasswordFormat = 1

c.       UserAccountStatus = 1

d.      IsAnonymous = 0

e.       ForceLogin = 1

2.      Add a record to the blog_UserProperties table:

a.       UserID, copy from blog_GenericUsers table.

b.      UserConfig = 3

3.      Add a record to the blog_Roles table:

a.       UserID, copy from blog_GenericUsers table.

b.      BlogID, copy from blog_Config table.

c.       BlogRoleID = 1

 

 

March 29, 2004

Merging Dottext 0.95 mods to 0.96 code base

My goal is to get on the latest code base with minimal mods for my skin and web service needs.

Created a snapshot of vaultpub as of 2004-03-30 11:31. I’m leaving the bulk of the source files out of Perforce and not using the Perforce SCC with Visual Studio. It corrupted my first shot at it to the point that I couldn’t do anything with the DottextWeb project in the Solution anymore, but it was fine by itself. Grrr…. Visual Studio crashed several times during debugging and the Dottext.Framework assembly kept getting lost and needed to be rebuilt when opening the solution and attempting to debug. This is behavior I haven’t seen in any other project (or earlier version of dottext). I wonder if it has anything to do with the worker threads started by the index generation events?

Copied OtherStuff\Configs\096_Web.config to DottextWeb and made changes.

Compiled solution files. Build works. Rebuild chokes. RichEditor.ascx.resx may not be checked in.

Created SearchIndex folder and gave ASP.NET account write access to it.

Added a FordeIndexUpdate.aspx page to force initial index population.

URL’s in search results are not right. Hostname and application name aren’t being combined correctly. Part of it is hard coding in 096db.sql, blog_aggregate_Search stored procedure, modified to remove hard coded ‘weblogs.asp.net’ in search permalink generation. That fixes the host part but the application part is missing. Realized that by editing the urlFormat attribute of the SearchConfiguration element in the Web.config file I could re-insert the DottextWeb without modifying any code. The “domains” attribute seems to restrict which blogs are aggregated in the index and can be a comma separated list of Hosts, as defined in the blog_Config table.

At this point the application appears to run well on localhost, including the search functionality and standard skins.

Adding the mods required by TonesNotes:

·        SimpleBlogService, added AddImageToGallery method, modified how categoryID is obtained.

·        Made Images folder writeable by ASP.NET.

Adding btone skin:

·        Added print.css copied from AnotherEon001

·        Added span.highlight style to style.css

·        Skins\btone\PageTemplate.ascx, change DT namespace back to UI.WebControls and ‘ContentRegion’ back to ‘contentRegion’.

·        Skins\btone\controls\BlogSearch.ascx, added.

·        Added btone to Admin\Skins.config

·        Modified btone\controls files: SingleColumn.cs, MonthList.cs, PostComment.cs

·        Added Skins\btone\UIData.cs with PostCategoryHyperLinks method.

·        Modified btone\controls files: Days.cs, EntryList.cs, ViewPost.cs

 

Initial merge complete.

 

 

March 25, 2004

Add aspnet to SQL db_owner role to enable execute permission on stored procedures.

When using Windows Authentication mode with .Text and a SQL Server Database.

The ASPNET account has to be given access to the database and added to the db_owner role.

 

March 24, 2004

Quicken 2004 & TurboTax 2003 Premiere Home & Business

Last year Intuit annoyed many people with overly strict copy protection on TurboTax 2002. Like many people, I bought TaxCut instead.

TurboTax 2003 crashed trying to import my 2002 TaxCut data file. Not a good start.

Quicken’s Business Center and Customer Invoices:

1.      Associating expenses with invoices requires flagging business expense transactions in the “Exp” field, found below “Charge” field in the register. Click on it and you get an “E” in the box. This enables choosing it from the invoice form when you click on “Expenses…”.

2.      The categories assigned to an expense are copied from the register to the Invoice form but changes don’t propagate from one to the other.

3.      Deleting an expense from an invoice only removes it from the invoice, the transaction remains, AND it still is marked with an “E” in the “Exp” field. Until you clear the “Exp” field, save the transaction, set the “Exp” field, and resave the transaction, you won’t be able to add the expense to an invoice.

4.      Deleting expenses from an invoice (to update them by re-adding modified transactions for example) may cause the amount of payments applied to the invoice to be reduced. The only way to fix this seems to be to delete the payment and recreate it. To avoid this you can add a temporary dummy item to the invoice and delete it afterwards.

 

March 22, 2004

Serializing DateTimes

A DateTime value doesn’t include time zone information. You must therefore keep track of the implied time zone by other means.

When DateTime values are serialized using the XML serializer, the default format includes the local machine’s time zone, which may not be correct, if for example your keeping all DateTime values in UTC.

On the flip side, deserializing a DateTime will return a value adjusted for the local time zone, taking the serialized time zone value into account.

Clemens Vasters has a nice detailed write up of the DateTime UTC serialization problem and answered my question of whether there was a way to tell the serializer how to handle the time zone.

 

solution task’s webmap element has case sensitivity and EntityName parsing bugs

The solution task was failing with a 403 error looking up webmap map entries until the casing on the url was matched to the casing in the solution file (.sln). Since the solution file’s casing is arbitrary (whatever you typed in when you added the project), this isn’t the right behavior.

Error checking whether 'http://localhost/virtualdirectory/root.csproj' is an enterprise template project.

 The remote server returned an error: (403) Forbidden.

 

A second bug appears to be Microsoft’s, a .csproj <File> element with a RelPath attribute value containing an ampersand causes a NAnt solution task error of

An error occurred while parsing EntityName.

The ampersand should have been converted to an entity reference of &amp;. That makes NAnt happy, but breaks Visual Studio. We’re not quite all there yet with XML are we….

 

www.answersthatwork.com identifies Windows Task List entries

www.answersthatwork.com maintains a list of Microsoft Windows processes you might see running with information about what they do.

 

March 09, 2004

Cryptography, Collision example for SHA1

I found myself wondering today, exactly how good is SHA1? It is the accepted standard for cryptographically strong hash functions but exactly how rare are random collisions on ordinary file systems?

In One-Way and Collision-Resistant Functions, 2004-01-07, UCSD CSE 107, by Mihir Bellare, I found the statement that “nobody has yet found (meaning, explicitly presented) a collision for SHA1.”

Wow. That’s an amazing hash function.

To see if I believe that, consider all 21 byte files. There have to be at least 256 SHA1 hash collisions to be found (since SHA1 is 20 bytes). An exhaustive, brute force approach would have to examine around 1.5 x 10+48 files to get in the ballpark. That’s a trillion, trillion, trillion, trillion cases. Hmmm…. Okay. It’s possible.

 

Automating Windows Forms testing

March 08, 2004

Can’t checkin from Visual Studio using version version 2003.2-54310 of P4SCC

 

I first noticed this problem with the beta version of 2003.2 P4SCC and now suspect it’s a configuration problem peculiar to my setup.

I am unable to check files in from Visual Studio .NET 2003. I can view pending checkins normally, but when I click “Check In”, I get this dialog box with all controls disabled except the close box.

What should be happening and why might this be happening?

 

 

March 02, 2004

Automating web site management, NAnt, WebDav, Windows 2003 Server VPN

Looking at NAnt, VPNs, WebDav, and other tools for automating web site management. What’s really needed is an index of each file on the site indicating where it came from and an integrated set of release tools/scripts to maintain and key off the index. Sounds like a description of software that exists out there and is priced at stratospherically ridiculous “enterprise” levels.

The goal is to be able to automatically and efficiently propagate a change to one of many Visual Studio projects or even in a folder of files to the web server. A related goal is to be able to automatically publish a new release of a project.

NAnt seems like a good framework for building the scripts, but it seems to lack a way of managing remote files. With a VPN to the server, that wouldn’t be a problem except potential efficiency issues if scripts can’t be written to minimize the amount of uploading.

For future reference, Sitecopy is a cygwin based tool for synchronizing a local file tree with a remote one and supports WebDav.

WebDav is a bit of a mystery. Windows 2003 Server allows WebDav to be enabled on a web site. Windows XP can then add Network Places that provide Windows Explorer level access to the remote files. There doesn’t seem to be any programmatic support in .NET for it though.

Downloaded independentsoft.de’s .NET webdav support. It didn’t appear to work initially. Couldn’t copy a file or list folder contents. Fired off an e-mail to support which they responded to quickly. Unfortunately the library is obfuscated which makes trying to guess what the problem is hard. They’ll give you source code access but for much more money. Turns out they may only have a bug accessing the root folder of a site. My other difficulties were due to not realizing that Write and Directory browsing permissions were required by WebDav. They aren’t required for “Web Folder” access which Microsoft seems to link with WebDav but appears to march to a different drummer.

To “enable” WebDav on IIS 6.0, the first step is to enable it generally as a configured web service, and second, to enable Write and Directory browsing access via IIS for each site/vroot to be accessed. It appears as long as there is a valid default document, HTTP requests that specify only the folder do not generate folder listings. I have not confirmed, but suspect, that Windows ACLs combined with WebDAV NetworkCredentials can effectively restrict the users with WebDav access. WebDav traffic is encrypted only if the site supports SSL. Otherwise passwords “may” be encrypted, presumably only if integrated windows authentication is used and plain text credentials aren’t passed explicitly.

Getting a VPN up between my collocated Windows 2003 Server and my Windows XP workstation required adding Routing and Remote Access as a server role, configuring a range of static IP addresses (don’t configure DHCP unless its needed for other reasons) on a different subnet from my home network, and punching a hole through my firewall for PPTP, IPSec, and L2TP (UDP 500, 4500, 1701). There’s an attitude in the security space that non-hardware-SSL based VPN’s are problematic. Probably a combination of security and performance issues.

While waiting for progress on the VPN & WebDav fronts I started coding a custom file tree merge Web Service. I was in the middle of this when I happened across John Shewchuk’s MSDN TV interview about Indigo. Quite amusing to have him comment on how Indigo was going to help facilitate just the kind of plumbing work I was hacking away at.

 

 

March 01, 2004

NAnt 0.84 installation and initial test problems, 2004-03-01 17:39:26 Monday

To change the default .NET framework to 1.1 instead of 1.0, edit the NAnt.exe.config file found in the bin folder and change <platform name="win32" default="net-1.0"> to <platform name="win32" default="net-1.1">.

The test at line 221 of tests\NAnt.Console.NAntTest.cs fails because the copyright year hasn’t been bumped up to 2004 yet. Comment it out for now.

The C++ tests fail because vsvars32.bat wasn’t automatically configured and the cl task fails.

I followed this registry tweak to automatically run vsvars32.bat whenever cmd.exe is run.

 

 

webinfo files simplify locating ASP.NET projects with Visual Studio .NET

If you’ve ever had trouble adding an existing web application to a solution when the application isn’t under the c:\inetpub\wwwroot folder, adding a webinfo file to the project may help. Typically I have this problem when I use source control to copy my development files to a new machine and need to re-establish proper registration with IIS. It sometimes seems simplest to remove references to projects in a solution that aren’t loading on the new machine and to add them again as existing projects.

The typical error message I get when adding the existing project is:

The project you are trying to open is a Web project. You need to open it by specifying its URL path.

 

The trick to successfully adding an existing project is to use a file path with a webinfo file instead of an http path, despite what the error message says.

When you create a new web application using Visual Studio .NET 2003 a webinfo file is created automatically for you. This file defines the web path to the application. If the file is missing, or the contents of the file no longer agree with the configuration of your web server, you will have trouble adding the project.

For example, say you have http://localhost/QEs as a virtual directory to “c:\Projects\Quick Experiments” and you have a web application in the folder “c:\Projects\Quick Experiments\WebApp1”.

The project filename is “WebApp1.csproj” and the corresponding webinfo filename is “WebApp1.csproj.webinfo” with the contents:

<VisualStudioUNCWeb>

    <Web URLPath = "http://localhost/QEs/WebApp1.csproj" />

</VisualStudioUNCWeb>

 

Once you’ve added this file to the project folder, you should have no trouble adding the project to a solution by specifying the file path “c:\Projects\Quick Experiments\WebApp1\WebApp1.csproj”.

For no good reason of which I’m aware, this seems to work far more reliably than trying to add the project with the web path of “http://localhost/QEs/WebApp1/WebApp1.csproj”