2

I'm hoping to use something like the code put forward by MartinHN in the following post to create HTML formatted SMTP mail items: SO POST

Having problems creating a reference to the correct assemblies so that I can use the namespace "System.Web.UI.WebControls". the reference I'm trying to add is "System.Web" as suggested in HERE

In the .NET section of my vis stud project's references I do not have System.Web:

enter image description here

If I browse my C-Drive and add a System.Web.dll file then I get the following:

enter image description here

How do I configure this project so that I'm able to use MailDefinition ?

Community
  • 1
  • 1
whytheq
  • 34,466
  • 65
  • 172
  • 267
  • Is your project setup to target the client profile versions of .NET? – Arran Sep 23 '12 at 19:34
  • alright Arran - just spotted this : [SO POST](http://stackoverflow.com/questions/6338205/missing-system-web-reference-in-asp-net) ...my is a console app - I've just changed and will see what happens – whytheq Sep 23 '12 at 19:36

1 Answers1

5

If you change target framework from .NET client profile to .NET Framework 4 you shall be able to add system.web reference even in console Application.

Attached here are the Sreenshots from VS2012

enter image description here

enter image description here

Abhijeet
  • 13,562
  • 26
  • 94
  • 175
  • @whytheq .NET Framework 4 Client Profile is a subset of the .NET Framework 4 that is optimized for client applications. That is why system.web dll is not available. – Abhijeet Sep 24 '12 at 12:07
  • I pretty much always accept answers but quite often I leave questions open for some time first - just in case anyone else wants to contribute. I can't imagine anyone else will be able to add any further value than your answer. – whytheq Sep 24 '12 at 12:27