简体   繁体   中英

What is The Nuget Package For System.Web.Hosting

I have been researching but I can't seem to find any relevant answer. I will appreciate it if someone told me the nuget package to install in asp.net webapi application for System.Web.Hosting

I need it to use Hosting.HostingEnvironment.MapPath("")

添加对System.Web程序集的引用,然后您将能够访问 System.Web.Hosting.HostingEnvironment

Since this is in the System namespace, its very likely part of the Framework.

Googling for that namespace brings it up on MSDN. So, open up the documentation for that namespace on MSDN . Click on any class in the list, it doesn't matter which.

You will see something like this:

Namespace: System.Web.Hosting
Assembly: System.Web (in System.Web.dll)

You now know which assembly this particular class is in, which likely also contains most of the rest of the desired namespace. Check another class on MSDN to confirm. Well, this is System.Web . That's part of the Framework.

If you do this for another namespace and can't find it on MSDN, you're probably looking for a Nuget package. But in this case, nope. Just add a reference to the assembly.

System.Web is not a nugget package.

Go to Solution explorer > References > Add References > Framework > look for System.Web.

System.Web.Hosting.HostingEnvironment.MapPath(string.Empty);

对于 .Net Core 使用

Microsoft.AspNetCore.Hosting

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM