Hi Madison,
From your description, when you try using a custom webserver control(in a
separate class library assembly) as global registered control in web site
application, you encoutner "request for
'System.web.AspNetHostingPermission'" error ,correct?
Regarding on this error message, I've ever seen some former threads & cases
discussing on the similar problem, and most of them are caused by .NET cas
code access security problem. So far I haven't found any different between
"web site project" and " web application project" on this custom control
behavior. Here are some causes you can check based on those former issues I
found:
** You're referencing a 3rd party or external assembly which is compiled
through .NET 1.X
** Your ASP.NET web application is not in "Full Trust" CAS level while your
custom web control require Full Trust hoster
** Your ASP.NET web application web directory is on a UNC share that cause
your ASP.NET application code be evaluated as Intranet zone (not full trust)
Also, I've performed a very simple test as below:
1) create a custom control class library that contains a custom control
derived from TextBox (no additional code)
2) create an ASP.NET 2.0 web site project and reference the class
library(created in #1)
3) use <pages><controls> to register the control as global one and use it
in page
the test applciation runs ok without problem. BTW, I use a file server(test
server) project, If you're using IIS server, please feel free to let me
know.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.