I'm also using a GUID as a PK. My PK default setting is...
(CONVERT([uniqueidentifier],CONVERT([binary](6),getdate(),(0))+CONVERT([binary](10),newid(),(0)),(0)))
I've been going through the subsonic source and I'm beginning to think that this is related to the fact that... shiz I don't quite know.
I do know that Subsonic isn't seeing the NOT NULL, PK, Default Setting having column as READ ONLY.
So, assuming you don't have any other PK datatypes in the solution, you could add a few lines to the Structs.tt file...
Find the foreach loop on line 30...
<# foreach(var col in tbl.Columns){#>
Columns.Add(new DatabaseColumn("<#=col.Name#>", this)
{
IsPrimaryKey = <#=col.IsPK.ToString().ToLower()#>,
DataType = DbType.<#=col.DbType.ToString()#>,
IsNullable = <#=col.IsNullable.ToString().ToLower()#>,
AutoIncrement = <#=col.AutoIncrement.ToString().ToLower()#>,
IsForeignKey = <#=col.IsForeignKey.ToString().ToLower()#>
<# if (col.IsPK.ToString().ToLower() == "true"){ #>
, IsReadOnly = <#=col.IsPK.ToString().ToLower()#>
<# } #>
});
The section you're adding is the IF statement just after IsForeignKey.
This should make it work for your your PK Guids so long as you have something in default setting.
I can't make any guarantees about any other PK's you may have in the DB though. You've been warn'd.