I am using another piece of software that will be executing a C# Script.
I am using VS2022 to code that script because the other software’s IDE sucks.
All I’m trying to do is run this code (to begin with):
using System.Web.UI.HtmlControls;
using (StringWriter sw = new StringWriter())
{
Table t = new Table();
TableRow tr = new TableRow();
TableCell td = new TableCell {Text = "Some text... Istanbul"};
tr.Cells.Add(td);
t.Rows.Add(tr);
t.RenderControl(new HtmlTextWriter(sw));
string html = sw.ToString();
Console.Write(html);
}
When I execute I get “UI doesn’t exist in namespace System.Web”.
???
So now I’m trying to add a reference, but I can’t figure out how to do this.
In Reference Manager there’s nothing to chose from except COM stuff.
I browse to “C:WindowsMicrosoft.NETFramework64v4.0.30319System.Web.dll”, but when I chose it, it says “The reference is invalid or unsupported.”
What the heck am I supposed to do here?
Why is this so difficult. It didn’t used to be in earlier versions on VS.