1
votes

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.

1
Maybe the version of the DLL in the GAC and in the BIN folder is different?ronen
They are both 1.0.0.0. I was wondering about that too, but the fact that neither one works by itself makes this all the more confusing!Web User

1 Answers

0
votes
<%@ 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.