.Text - take two

i have been wrestling with trying to get the source version of .Text to run for the last 2 hours and have hit a roadblock. here is a description of what i am running into, basically that no content was showing up when i compile and run from VS.NET, even though it's pointed to the same DB that my production blog uses. so i decided to get under the hood to try and figure out what is going on and this is what i discovered. basically, the way that the DB is designed is that the blog_Content table keeps track of the content according to the BlogID field in blog_Config which in itself is fine. however, the BlogID is unique per host name, in this case i have the hostname 'zerotrilogy.gotdns.com' mapped up to BlogID field '0', ... {rows of other hostnames} ... all the way to localhost (as when you compile and run, this is the hostname), which is mapped to BlogID field of 0 + n (where n is the number of rows from zerotrilogy.gotdns.com). the issue is that since there is a different BlogID associated with localhost, it maps up a fresh set of content from the blog_Content table...of which there is none.

so i thought it would be wise to start hacking around in the blog_Config table to get all the BlogID values to be the same as my production site (0)...dropped the primary key, removed the identity, and manually numbered all the values to '0' (the only things i did do right in the end were backing up the db first and scripting the table out to a .sql file). initially this worked fine, all the content showed up as expected, i was able to push new code over to my web server, etc. of course when i started trying to change config settings via the .Text admin console, it all blew up to hell as sprocs were looking for primary key refs on BlogID in blog_Config. the DB restore didn't work (guess that doesn't store schema changes?), so i dropped the table and brought it back via the SQL script. i then started getting invalid cast exceptions and it took me another little while to realize that for yet another unknown reason, the table script didn't script out the default contraints that are defined in the create script for that table (NULL values were being store in the columns, and i guess .Text didn't like that too much). i ultimately had to pick through the sql build script that shipped with .Text and pick out all the blog_Config DDL statements to get that table back. i was about to rant and rave about the design of .Text, but just realized something embarassingly simple...see below

even as i post this blog, i just realized that there is a setting in blog.config where you can hardcode the host and application name, it's the last couple of lines. that's what i get for not RTFM :-)

first order of business now that i have source code up and running is to get rid of that god awful orange XML icon linking to syndication. cheers

No comments yet