I get that the MembershipProvider is in the System.Web.Security namespace. I have added a reference System.Web in my project, I've added a using System.Web.Security directive in my .cs file - but as you can see, VS2010 does not believe me:
The type or namespace name 'MembershipProvider' could not be found
(are you missing a using directive or an assembly reference?)
What am I missing here?
You need to add a reference to System.Web.ApplicationServices.dll.
This is mentioned in the MembershipProvider help:
Namespace: System.Web.Security
Assembly: System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)
Google result of the day:
It is in the assembly System.Web.ApplicationServices.
Related
Application is based on .NET 4.0 (Property window shows the same). I am trying to implement routing in ASP.NET Webforms. I added global.asax and trying to register routes. I tried adding below line to Glabal.asax
<%# Import Namespace="System.Web.Routing" %>
It throws an error : The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
I'm not missing an assembly reference. I added reference to system.web(4.0) and system.web.routing(4.0) as well. Its still not working.
I don't know what is wrong here. Any help is appreciated
Simply add the reference from Assemblies:
As #Fred indicated, please see Which NuGet package contains System.Web.Routing?
I can't get to use GZipStream class in my C# ASP.NET 4.5 application.
I get the error:
The type or namespace name 'GZipStream' could not be found (are you missing a using directive or an assembly reference?)
I tried using using System.IO; but the System.IO.Compression is not available in the "Reference Manager" in visual studio. I right click on the object name to see if Visual Studio finds the relevant reference but it does not.
Any suggestions?
Need to add reference to System.dll assembly and using System.IO.Compression namespace.
MSDN: GZipStream Class
The namespace is not the same as the dll name,You need to add a dll reference to the assembly, System.IO.Compression.FileSystem.dll
I have configured tfs build definition for our project. And also i have added Nuget package to the solution.
When i tried to build the defination, i'm getting following error.
App_Start\BundleConfig.cs (7): The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Global.asax.cs (10): The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
App_Start\BundleConfig.cs (20): The type or namespace name 'BundleCollection' could not be found (are you missing a using directive or an assembly reference?)
I don't know why i'm getting this error.
Could anyone please help me with this????
Check your Build definition -> Source Settings tab. You should add path to packages folder where referenced packages are stored.
In My c# windows form it has a error
The type or namespace name 'OperationContext' could not be found (are
you missing a using directive or an assembly reference?)
can any one explain me the reason??
OperationContext is a class defined in the assembly System.ServiceModel contained in the library file System.ServiceModel.dll
If you try to use this class you need to add the reference to the library through Project References and then add a
using System.ServiceModel;
in the file using OperationContext
because you didn't add the dll for access this class
read http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontext.aspx
you have to add System.ServiceModel dll
I am trying to check a service in C#, I have added the System.ServiceProcess.dll
Although I get the error:
Error 2 The type or namespace name 'ServiceController' could not be found (are you missing a using directive or an assembly reference?) D:\App\Form1.cs 247 13 App
My code is as follows:
private void button13_Click(object sender, EventArgs e)
{
ServiceController sc = new ServiceController("Spooler");
if (sc.Status == ServiceControllerStatus.Running)
{
MessageBox.Show("The service is running.");
}
}
Do I perhaps need a "using" statement?
You need to add a reference to the System.ServiceProcess.dll
After that, you will be able to see it in Visual Studio, as one of the using statements you can add to your project:
Pro Tip: When you are trying to use a class from the .NET Framework and you get a message like:
The type or namespace name '...' could
not be found (are you missing a using
directive or an assembly reference?)
Lookup the type in the MSDN Library and look under the Inheritance Hierarchy section to find the Namespace and Assembly you need.
Inheritance Hierarchy
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.ServiceProcess.ServiceController
Namespace: System.ServiceProcess
Assembly: System.ServiceProcess (in System.ServiceProcess.dll)
Then ensure that you have a reference to the assembly and a using directive for the namespace (assuming you don't want to fully qualify the name).
Yes, at the top.
using System.ServiceProcess;
For me (Visual Studio 2012) it was not a default addition when typing in "using"
I had to add a reference and search through the assemblies for System.ServiceProcess. (I believe it is located in the .NET tab in older versions of Studio).
Hope this helps any future viewers!