Bad Programmer
Bad Programmer

Reputation: 3772

System.Web.UI Reference In Visual C# 2010 Express

I am working on a project in Visual C# 2010 Express and need to use the following references: System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts;

When I go to Projects > Add eference > .Net and look at the list of available references, System.Web.UI isn't in there (although System.Web.Services and System.Web.ApplicationServices are options).

After some Googling and searching for related problems here on StackOverflow, I found that people were able to get System.Web.UI added by changing their client profile. However, that doesn't seem to be an option available to me in my Express edition; for example, if I go to Projects, there is no properties option, and I can't find properties under any other menu.

Does this mean that Visual C# Express doesn't allow for changing project profiles, or am I just searching in the wrong place?

Any help will be greatly appreciated.

Upvotes: 0

Views: 324

Answers (2)

Ram Murti
Ram Murti

Reputation: 13

I found something similar to your problem at this link. The first answer by #Hans-Passant explains the issue and solution in very simple manner. This worked fine for me.

"I'm ready to declare this a bug in VS2010, this has bitten way too many programmers already. The fix is easy: Project + Properties, Application tab, change Target Framework to ".NET Framework 4" instead of the Client Profile that is selected by default.

System.Web is not included in the client profile. Having this option in the first place is quite silly, the client profile is only 15% smaller than the full version of .NET 4.0. Having it selected by default is even sillier. But I digress."

Upvotes: 0

Damith
Damith

Reputation: 63105

you need to install Visual Web Developer 2010 Express if you need to create web project/ASP.NET Web Application. Visual C# Express supports for Windows Forms Applications, WPF Applications, Console Applications, Class Libraries etc.. but not what you want.

Upvotes: 1

Related Questions