When i writing: "System.W...", the intellisence isn't show me "System.Web" why?
Asked
Active
Viewed 8,897 times
3

Cody Gray - on strike
- 239,200
- 50
- 490
- 574

Glebka
- 1,420
- 3
- 20
- 37
-
1Have you built your solution after adding `System.Web`? Is it a web project? – Filip Ekberg Feb 15 '11 at 11:29
-
I can't repro this in a brand new web project in VS 2010. They don't target the "Client Profile" by default. Can you give us some more information? – Cody Gray - on strike Feb 15 '11 at 11:32
-
i just checked it.. i got intellisense. even in a console app (after adding a reference).. somthing is wrong – Shekhar_Pro Feb 15 '11 at 11:36
-
Just a wild guess.. @GLeBaTi, is your `DatabaseManager` class in the same project that we see in the screenshot? – Filip Ekberg Feb 15 '11 at 11:37
-
1@Shekhar: Right, everything is set up properly in the screenshot we've been shown. There's a reference added to `System.Web`, and ASP.NET applications don't target the Client Profile by default like their Windows counterparts. Something fishy is going on; I suspect we're being hoodwinked. – Cody Gray - on strike Feb 15 '11 at 11:37
-
@GleBaTi have you simply tried restarting VS10.. see if things smooth out. – Shekhar_Pro Feb 15 '11 at 11:41
-
+1 @Cody Gray: may be he is trolling.. but i wonder then how he got that screen shot.. – Shekhar_Pro Feb 15 '11 at 11:42
-
you know what this is fourth Intellisense problem i am seeing being asked this week on SO – Shekhar_Pro Feb 15 '11 at 11:46
-
This is not trolling. When i building my app, in Output window, i see: Release x86 – Glebka Feb 15 '11 at 12:29
-
What difference does it make what you see in your Output Window? The point is, this is absolutely **not reproducible** from the information you've given (minimal) and what eagle-eyed members of the community were able to ascertain from your screenshot. I didn't mean it was trolling, I meant that there's something fishy going on and there's not enough information provided to tell what. – Cody Gray - on strike Feb 15 '11 at 12:49
-
http://s010.radikal.ru/i312/1102/20/a3dd56d3c05b.jpg I can't join my App_Code namespace. May be it it reason? – Glebka Feb 15 '11 at 17:57
5 Answers
3
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.

RichardW1001
- 1,985
- 13
- 22
1
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?

Davide Piras
- 43,984
- 10
- 98
- 147
-
-
also it dosen' matter even if he is in a console app.. as long as he has refrence to dlls' – Shekhar_Pro Feb 15 '11 at 11:37
1
When i switch Build Action(of file *.cs) from "Content" to "Compile", my program began to work.

Glebka
- 1,420
- 3
- 20
- 37
-
1You forgot to mention that you'd changed the "Build Action" of your source files to something other than the default. No one was ever going to guess that one. Glad to see you've got your solution though; please accept this as the answer (by clicking the checkmark outline to the left) when the system allows you to do so. That way, people will know that the issue has been resolved. – Cody Gray - on strike Feb 17 '11 at 04:21
-
0
There could be various possibilities for such behavior:
- 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).
- 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"

Tahir77667
- 2,290
- 20
- 16
-1
Add a using statement as such:
using System.Web;

tzup
- 3,566
- 3
- 26
- 34
-
1You should still be able to access it by writing `System.Web...`, you wouldn't need `using` for that. – Filip Ekberg Feb 15 '11 at 11:27