|
|
Cry about...
|
| Name | Namespace | Common Qualified Name |
|---|---|---|
| Abs | Math | Math.Abs |
| AnchorStyles | System.Windows.Forms | |
| Application | System.Windows.Forms For Windows forms applications. |
|
| System.Web.HttpContext For web applications. |
Current.Application | |
| ApplicationDeployment | System.Deployment.Application | |
| Assembly | System.Reflection | |
| CultureInfo | System.Globalization | |
| Cache | System.Web.Caching | |
| ConfigurationManager | System.Configuration Also ensure that project contains reference to System.Configuration.dll |
|
| Current | System.Web.HttpContext | |
| Debug | System.Diagnostics | |
| Debugger | System.Diagnostics | |
| Dns | System.Net | |
| Directory | System.IO | |
| Encoding | System.Text | |
| EventLog | System.Diagnostics | |
| File | System.IO | |
| HtmlEncode | System.Web.HttpUtility | |
| HttpContext | System.Web | |
| HttpRuntime | System.Web | |
| HttpUtility | System.Web | |
| ImageFormat | System.Drawing.Imaging | |
| Marshal | System.Runtime.InteropServices | |
| NormalizationForm | System.Text | |
| Parallel | System.Threading.Tasks | |
| Process | System.Diagnostics | |
| Regex | System.Text.RegularExpressions | |
| Request | System.Web.HttpContext | Current.Request |
| Round | Math | Math.Round |
| SecurityMode | System.ServiceModel | |
| SecurityZone | System.Security | |
| Server | System.Web.HttpContext | Current.Server |
| ServicePointManager | System.Net | |
| SslPolicyErrors | System.Net.Security | |
| SmptMail | System.Web.Mail | |
| ThreadPool | System.Threading | |
| UnicodeCategory | System.Globolization | |
| UrlDecode | HttpContext.Current.Server.UrlDecode | |
| User | HttpContext.Current.User |
It is my intention to add to this table over time.
A less likely cause is that the project itself lacks a reference to the necessary library. This can arise when (for example) creating a class library and using web namespaces, for example:
Name 'HttpRuntime' is not declared
even though the line "imports System.Web" is included.
Add the reference to the project:
1. Right click the project in the solution explorer and select "properties".
2. On the "References" tab ensure that the required namespace is listed under "References" (do not confuse this with "Imported namespaces", the important thing is that it must be listed under "References".)
The necessary references are listed in the table above (shown under "Possible Cause 1"). For example the solution to "HttpRuntime is not declared" even though "Imports System.Web" is included in the file is to ensure that "System.Web" is listed as one of the project References.
These notes are believed to be correct for VB.NET for .NET 4, .NET 3, .NET 2 and .NET 1.1 frameworks, and may apply to other versions as well.
For the corresponding C# version of this article please see "The name NNNN does not exist in the current context".