Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
プロパティにアクセスする必要がある WebActivator ブートストラップがありServerます。具体的には、何が何であるかを知る必要がServer.MapPath("~")あります。
Server
Server.MapPath("~")
これを行う方法はありますか?
これを行う最善の方法は、単に呼び出すことHttpRuntime.AppDomainAppPathです。
HttpRuntime.AppDomainAppPath
または、任意のパスで MapPath を呼び出したい場合は、 を使用しますSystem.Web.Hosting.HostingEnvironment.MapPath("~/some/file.aspx")。
System.Web.Hosting.HostingEnvironment.MapPath("~/some/file.aspx")