Question

When i writing: "System.W...", the intellisence isn't show me "System.Web" why? enter image description here

Was it helpful?

Solution 3

When i switch Build Action(of file *.cs) from "Content" to "Compile", my program began to work.

OTHER TIPS

You have no reference to the assembly. Right click your project, Add Reference and add System.Web. You might also need to switch to targeting the full framework, which is in Projetc settings under Compile, in the Advanded dialog, it's the bottom dialog.

could it be because you are not in a Web Project?

what does it happen if you anyway create an object of System.Web namespace and build the project then try to edit your code?

There could be various possibilities for such behavior:

  1. You might have missed referencing some essential assemblies; because there is no .NET without these two things i.e BCL(Base Class Libraries) & CLR(Common Language Runtime).
  2. Wrong targeting of .NET Framework version. If you target .NET 3.5 or 4 client profile, you won't see ASP.NET assemblies.Solution, go to: Project > Properties > Target Framework. Change it from

".NET Framework 4 Client Profile" to ".NET Framework 4"

Add a using statement as such:

using System.Web;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top