How to reference the System.Web namespace?

When I write: "System.W ...", intellisence does not show me "System.Web" why? enter image description here

+3
source share
5 answers

When I switch the Build Action (* .cs file) from "Content" to "Compile", my program starts to work.

+1
source

You have no assembly reference. Right-click on your project, add the link and add System.Web. You may also need to switch to targeting the full framework, which is located in the Projetc settings in the Compilation section, in the Advanded dialog box, in the lower dialog box.

+1
source

, -?

, System.Web , ?

+1
source

Add a using statement as such:

using System.Web;
0
source

There may be various possibilities for this behavior:

  1. You may have missed a link to some important assemblies; because there is no .NET without these two things, that is, BCL(Base Class Libraries)andCLR(Common Language Runtime).
  2. Incorrect targeting of the .NET Framework version. If you are targeting a .NET 3.5 or 4 client profile, you will not see ASP.NET assemblies. Solution, go to: Project> Properties> Target Framework. Change it from

".NET Framework 4 Client Profile" before ".NET Framework 4"

0
source

Source: https://habr.com/ru/post/1792208/


All Articles