开发者

ASPX & ASCX compiled to separate assembly and therefore can not inherit from an internal base class?

开发者 https://www.devze.com 2023-03-15 02:36 出处:网络
I have a class internal class BasePage : System.Web.UI.Page in my common web library. It appears that the actual ASPX (markup) portion of a page is compiled outside of the assembly in which the code i

I have a class internal class BasePage : System.Web.UI.Page in my common web library. It appears that the actual ASPX (markup) portion of a page is compiled outside of the assembly in which the code is defined. This would mean that the class on both sides as well as the base class have to be public.

This is a "web application", not a "web site" project.

I have the assemblies setup as "friend assemblies" b开发者_StackOverflow社区ut the problem is that the ASPX is NOT compiled into the same assembly as the rest of the code in the Web Application. And therefore it can't access the internals of the assemblies.

The ASPX pages are generated to a random (?) assembly. My assembly's are all signed so I can't add the generated assembly, even if I knew what the name was, as a friend.

How can I enable a page to derive from an internal base class?


Have you looked into friend assemblies? I haven't tried it specifically with what you are trying to do, but it may still work.

Is there a reason you don't want the base type to be public?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号