Añadiendo ASP.NET Aplicación web a SharePoint Virtual Directory (para SPCONTEXT)
-
09-12-2019 - |
Pregunta
Estoy heredando una aplicación ASP.NET que está alojada dentro del sitio web de IIS SharePoint.Desde IIS, haga clic con el botón derecho en el sitio web y haga clic en 'Agregar aplicación' es el método utilizado aquí.
En nuestro servidor dev, donde el 'propietario' de la aplicación lo configura, SPCONTEXT está siendo poblado como esperaríamos.Sin embargo, en la producción, SPCONTEXT es nulo.
También he creado mi propia aplicación web de Test SharePoint, y agregué una aplicación web de Visual Stan Studio ASP.NET en esto para probar el problema SPCONTEXT ... Lamentablemente, SPCONTEXT es NULL.
servidor dev
Aplicación existente: SPCONTEXT!= NULL
Aplicación de prueba: SPCONTEXT== NULL
Prod Server
Aplicación existente: SPCONTEXT== NULL
Aplicación de prueba: SPCONTEXT== NULL
¿Qué estoy perdiendo que se necesita para obtener SPCONTEXT POBLADO?He intentado spcontext.getcontext (httpcontext.current), pero Spcontext.web es nulo entonces.Ideas?
Solución
Immediately after posting this, I had an idea. None of the web applications that are failing have a "Root" site collection. Technically there is no such thing as a root site collection, but I created one in the Prod Server > Existing App (at the '/' managed path) and things magically started working.
So it seems that SPContext somehow is defaulting to WebApplication.Sites[0]