简体   繁体   中英

Can't import System.Web namespace

I am trying to use:

using System.Web.UI.HtmlControls;

In windows forms, but it tells me a reference is missing. So I went in the add reference but System.Web isn't on the list. I even tried going to the physical location of System.Web.Dll but when I added it it told me that it can't find the assembly.

I have no problem importing the assembly in an ASP.NET application.

Note if your project targets ".NET Framework 4.0 Client Profile" then this class will not work, you need to re-target your project to ".NET Framework 4.0" instead. [Credit to Matt Neerincx [MSFT] who posted this on msdn]

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