SharePoint仮想ディレクトリへのASP.NET Webアプリケーションの追加(SPContext用)

sharepoint.stackexchange https://sharepoint.stackexchange.com//questions/45201

  •  09-12-2019
  •  | 
  •  

質問

IIS SharePoint Webサイト内でホストされているASP.NETアプリケーションを継承しています。IISから、Webサイトを右クリックし、[アプリケーションの追加]をクリックすることがここで使用される方法です。

私たちのDEVサーバーでは、アプリケーションの「所有者」が設定されている場合、SPContextは私たちが期待されるようになるので入力されています。ただし、製造では、SPContextはnullです。

私は自分のテストSharePoint Webアプリケーションを作成しました。

devサーバ

既存のアプリ:SPContext!= null

テストアプリ:SPContext== NULL

prodサーバ

既存のアプリ:SPContext== NULL

テストアプリ:SPContext== NULL

SPContextを取得するのにかかるのは何がありませんか?私はSpcontext.getContext(httpContext.current)を試しましたが、SPContext.webはNULLです。アイデア?

役に立ちましたか?

解決

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]

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top