vs2005开发webpart部署后看不到的原因
时间:2010-05-29 来源:sdwjian
看不到自己的webpart有几个原因: <?xml version="1.0" encoding="utf-8"?> <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" > <Title>Kaneboy's Sample WebPart</Title> <Description>Kaneboy's SampleĹWebPart, Heihei! :)</Description> <Assembly>SampleWebPart</Assembly> <TypeName>SampleWebPart.WebPart1</TypeName> <!-- Specify initial values for any additional base class or custom properties here. --> </WebPart>
|
导入报错:
在SharePoint中,写了一个WebPart,编译成功后,成功部署到了SharePoint网站中,但在添加Web部件中,出现如下错误:
“无法添加选择的web部件,webpart名称为了成功导入,必须使用AllowPartiallyTrustedCallersAttribute设置来编译用于实现ASP.net web部件并装在不完全信任位置(如bin目录)的程序集”
解决办法:在webpart所在项目的AssemblyInfo.cs文件中。添加引用“using System.Security;”,然后在文件的下面添加一句“[assembly:AllowPartiallyTrustedCallers]”。重新编译,部署就可以了。
配置WebPart