So I'm inside a web scroped feature (properties.Feature.Parent = SPWeb).
How do I get the SPWebApplication from this SPWeb?
I tried:
SPWebApplication w开发者_如何学GoebApp = (SPWebApplication)properties.Feature.Parent;
But of course I get an exception because I cannot cast the SPWeb object as an SPWebApplication.
You can try:
SPWeb web = properties.Feature.Parent as SPWeb;
SPWebApplication webApp = web.Site.WebApplication;
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论