问题描述: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