在这两个GAC和\\的Inetpub \\ wwwroot的\\ BIN需要ASP.NET DLL [英] ASP.NET DLL required in both GAC and \Inetpub\wwwroot\bin

查看:118
本文介绍了在这两个GAC和\\的Inetpub \\ wwwroot的\\ BIN需要ASP.NET DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我复制一个ASP.NET应用程序的DLL到\\的Inetpub \\ wwwroot的\\ bin并复制下SharePoint 2007的模板\\ Layouts文件夹的应用程序文件夹,这样我就可以访问 HTTP应用:// SP-门户/网站/ sitecoll123 / _layouts / aspnetapp / Default.aspx的。它抱怨说:

请求类型的权限'System.Data.SqlClient.SqlClientPermission,System.Data这,版本= 2.0.0.0,文化=中性公钥= b77a5c561934e089'失败。在System.Security codeAccessSecurityEngine.Check(对象的需求,StackCrawlMark&安培; stackMark,布尔isPermSet)。

然后我安装了DLL到GAC(从\\的Inetpub \\ wwwroot的\\ bin文件夹中取出后),它无法加载DLL。它抱怨说:

无法加载类型AppNS.Default。在System.Web.UI.TemplateParser.GetType(字符串的typeName,布尔IGNORECASE,布尔throwOnError)

然后,我复制回该DLL到\\的Inetpub \\ wwwroot的\\ BIN,同时仍留有安装在GAC以及组装。只有这样,它的工作!我无法解释这个...我想有它在GAC是获得大会可访问轻易的快速和肮脏的方式。为什么它需要在这两个地方?这是在Sharepoint / MOSS 2007。

_layouts下安装了一个ASP.NET 3.5应用程序
解决方案

 <%@大会名称=AppNS,版本= 1.0.0.0,文化=中性公钥= d5e3267159f21fb6 %GT;

失踪在Default.aspx的,以及在一个页面控件(ASCX),这是需要引用安装在GAC大会。在这两个文件中加入这一行后,我能够从\\的Inetpub \\ wwwroot文件删除DLL \\ bin中,仍然有功能的应用。

I copied an ASP.NET application DLL into \Inetpub\wwwroot\bin and copied the application folder under Sharepoint 2007 TEMPLATES\Layouts folder, so I could access the application from http://sp-portal/sites/sitecoll123/_layouts/aspnetapp/Default.aspx. It complained that:

Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)

I then installed the DLL to the GAC (after removing it from the \inetpub\wwwroot\bin folder) and it could not load the DLL. It complained that:

Could not load type 'AppNS.Default'. at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError)

Then, I copied back the DLL into \Inetpub\wwwroot\bin, while still leaving the assembly installed in the GAC as well. Only then it worked! I cannot explain this... I thought having it in the GAC is the quick and dirty way of getting the assembly to be accessible easily. Why does it need to be in both places? This is an ASP.NET 3.5 application installed under _layouts in Sharepoint/MOSS 2007.

解决方案

<%@ Assembly Name="AppNS, Version=1.0.0.0,Culture=neutral,PublicKeyToken=d5e3267159f21fb6" %>

was missing in the Default.aspx as well as in a page control (ASCX), which was needed to reference the assembly installed in the GAC. After adding this line in both files, I was able to delete the DLL from \Inetpub\wwwroot\bin and still have a functional application.

这篇关于在这两个GAC和\\的Inetpub \\ wwwroot的\\ BIN需要ASP.NET DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆