2012年5月29日 星期二

FormsAuthentication.Decrypt 總是回傳 null

修改一個vs2008寫的 專案.
在debug模式下,進行到 FormsAuthentication.Decrypt ( mycookie.value) 時老是回傳null
 但publish後執行卻又很正常?

查到 Tony's Programming Blog 的文章
情況很類似,查看KB 2656351 後,發現作業系統是windows 7的環境, 但我的環境是windows XP!!

使用Google 查找關鍵字 kb 2656351 .net 3.5
找到了KB 2656352適用在windows XP 的安全性更新

下載後執行安裝, 問題就解決了.

2012年5月17日 星期四

使用Data Dictionary Creator

如果是重度使用SQL Server Extended Property來記錄額外的欄位資訊者
Data Dictionary Creator 這個工具一定要下載來用.
方便你建立額外的自定義屬性例如中文名稱,備註,tooltips等等


他預設會顯示MS_Description這個屬性, 如果你有一些自定義屬性也要顯示,
則在Advanced Setting頁籤中,指定這些額外屬性名稱,如下圖,多個屬性用逗點隔開


接著在DocumentDatabase頁籤中,就會出現這些額外屬性的定義了.如下圖:


真方便.

select a.name,b.column_id,b.name,d.value,d.name
 ,c.name,c.xtype,b.max_length,b.is_nullable
  from  sys.tables a inner join  sys.columns b
    on a.object_id = b.object_id inner join sys.systypes c
    on b.system_type_id = c.xusertype left outer join  sys.extended_properties d   
   on a.object_id = d.major_id and b.column_id = d.minor_id
 order by a.name,b.column_id

 這樣也是可以讀取到所有的欄位及屬性

publish error allowDefinition='MachineToApplication'

一個老舊的aspx web form專案,調了一些功能建置成功,但進行部署時顯示以下錯誤。 在應用程式層級之外使用註冊為 allowDefinition='MachineToApplication' 的區段發生錯誤。錯誤的原因可能是虛擬目錄尚未在 IIS 中設定為...