Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Web.UI not available in console app?

Im trying to write a quick console app that outputs data to an HTML file, however im having trouble accessing the System.Web.UI namespace.

Adding System.Web to my references places a warning icon on top of the reference name in the solution explorer and System.Web is not available in the .NET reference list (in order for me to actually add it to the project I have to go to the object browser and add it from there).

Anybody have any ideas about what I could be missing?

Thanks alot people!

like image 283
Walter Avatar asked Jun 13 '10 17:06

Walter


People also ask

What is using System Web ui WebControls in c#?

WebControls Namespace. Contains classes that allow you to create Web server controls on a Web page. Web server controls run on the server and include form controls such as buttons and text boxes.

What is Systemui Web?

System. Web. UI represents an . aspx file, also known as a Web Forms page, requested from a server that hosts an ASP.NET Web application. The Page class is associated with files that have an .

How do you add references to System Web?

After Googling around a little bit I found that the common answer to this question was to add a reference to System. Web. dll by finding it in the list presented by right-clicking on References in the Solution Explorer and clicking "Add Reference...".


1 Answers

In Visual Studio 2010 the default target framework for Console Applications is ".NET Framework 4 - Client Profile" which doesn't include System.Web. Change it in the project properties to just '.NET Framework 4' and you can add the reference.

like image 124
John Sheehan Avatar answered Oct 15 '22 12:10

John Sheehan