Win7下VS2010使用「ASP.Net 3.5 Claims-aware Template」建立ClaimsAwareWebSite報"HRESULT: 0x80041FEB"錯誤的解決辦法

問題描述:web

使用VS2010的WIF開發模板建立「Claims-aware ASP.NET Site」、「Claims-aware WCF Service」,下載安裝後,建立網站時,報錯"HRESULT: 0x80041FEB",其餘模板「ASP.NET Security Token Service Web Site」、「WCF Security Token Service」的STS時無此問題;網站

問題分析:this

插件發佈地址http://visualstudiogallery.msdn.microsoft.com/34783f43-91b0-42ee-90f4-b82bdb4ac91f?SRC=VSIDE有就此問題的解決方案,此問題由插件自身的Bug致使。spa

The Template has a bug which can result in the error "HRESULT: 0x80041FEB" after trying to create a new project out of it. To resolve the problem follow these instructions:
After you have installed the template, open the file "%AppData%\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\ASP.Net 3.5 Claims-aware Template\1.0\~PC\ProjectTemplates\csClaimsAwareASPNETSite.zip\ClaimsAwareASPNETSite.webproj" with Notepad++ or any similar advanced text-editor (it should be possible to display special characters/bytes). The content of the file is simply (without the "---" lines which mark beginning and end of the file content):
---
C#
$targetframeworkversion$
---
However, at the end of the second line (and therefor at the end of the file) there's a NUL byte/character (of the byte value 0x00) which will be displayed as such only in an advanced text-editor like Notepad++, in the standard Notepad editor it will be displayed as a space character. No matter in what editor you are and how it's displayed to you, delete this last character, so that the file will end with the $ sign, and save the file. Now you can use the template in Visual Studio without any more errors.

但在「"%AppData%\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\」目錄下未能找到文件夾「ASP.Net 3.5 Claims-aware Template」,故暫時沒法採用去掉空格的辦法。插件

問題解決:code

以建立「Claims-aware ASP.NET Site」時遇到問題的解決方法爲例:blog

1、本機搜索關鍵字「ClaimsAwareASPNETSite.webproj」,在以下目錄找到模板安裝文件夾,ip

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplatesCache\Web\CSharp\0ci

2、複製該文件夾建立到,「%AppData%\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\」下,路徑規則同其餘模板;開發

3、再次安裝VS插件,新插件會覆蓋第二步手動建立的文件,從而能夠修改的「ClaimsAwareASPNETSite.webproj」文件;

4、打開該文件,按英文描述,去除第二行末尾的空格;

5、重啓VS2010,再次使用此模板,問題解決,模板ClaimsAware網站可建立成功。

PS:建立Claims-aware WCF Service時也會遇到一樣問題,解決辦法相似。

writen by Bob Pan@20140615

相關文章
相關標籤/搜索