.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Error Build: Type or namespace could not be found, when referencing a web service

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :.NET Framework
Hello, I'm new in writing C# application in Visual Studio 2008. I'm currently writing a web application for CRM 4.0 Reporting Service rendering. I reference my web application to our Reporting Service web service http://reportservername /ReportServer/ReportExecution2005.asmx and name it 'RSWebReference'. Then I want to reference it in my code: Using RSWebReference; Not sure why, but I cannot build my solution, saying "The type or namespace name 'RSWebReference' could not be found (are you missing a using directive or an assembly reference?)". I read this thread in http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/74f70e30-83e8-4817-b5e0-7729450730a1 that the website probably is using .net 1.1, and I should change it to .net 2.0. However, I think the website is already using 2.0. Is it probably because I'm using VS 2008? How can I tell and change if the website is using 1.1 or 2.0? Or could I be doing something wrong? Thanks in advanced for your help! -Elizabeth K.

View Complete Post

More Related Resource Links

DotNetZip Library Error - The type or namespace name 'Ionic' could not be found


I try to add some Zip functionality of my website. I use DotNetZip from Codeplex. It works without any problem in my Development Machine (Windows XP). So I upload the files to the WebServer. Now I am getting the following error.


Compiler Error Message: CS0246: The type or namespace name 'Ionic' could not be found (are you missing a using directive or an assembly reference?)

How can I debug it. Please help me.

VS 2010 and The type or namespace name 'AjaxControlToolkit' could not be found error?



I've installed VS2010 and I'm trying to compile my .NET 2.0 app. It went through a conversion process when I opened it, I made a backup, but I'm still targeting .NET 2.0 for now.  I have a project reference and the "ajaxcontroltoolkit.dll" in the \bin and it ran fine in VS 2008.  Do I need a different version of the toolkit I currently have (1.0.10301.0 which targets runtime v2.0.50727) to run .NET 2.0 in VS2010 now?

The error "The type or namespace name 'AjaxControlToolkit' could not be found (are you missing a using directive or an assembly reference?)"

The warning gives more info

"Warning 27 The primary reference "AjaxControlToolkit, Version=1.0.10301.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "AjaxControlToolkit, Version=1.0.10301.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e, processorArchitecture=MSIL" or retarget your application to a f

Type or namespace error.


A couple of days ago I started getting an unusual behavior when compiling Website projects. I have referenced class libraries added to my bin folder that are also correctely referenced in using statements in my aspx.cs code behind. When I compile, I get the 

Error 4 The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?) C:\Dev\Fiscal_Portal\Implementation\FMS Portal Site_new\App_Code\BLL\DataTables.cs 1 7 C:\...\FMS Portal Site_new\

The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?)

error message that would typically be received when the dll has not been added as a reference or added in a using statement.

I can eliminate the error by adding an


Error Consuming Web Service - Unable to import binding xxx from namespace ...


In VS2008 / C# / ASP.NET 3.5, I wrote a test web service app. Here is an extract from the code:

namespace emed.MathWebService
    /// <summary>
    /// Sample Math Services For Learning Web Services Deployment
    /// </summary>
    [WebService(Namespace = " http://localhost/MathService")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class MathService
        public float Add(float a, float b)
            return a + b;


I have published this to an IIS virtual directory named MathService, and when I try to launch it with the URL http://localhost/mathservice/MathService.asmx is works fine and displays all the operations (Add, Subtract etc) in the service.

I then created a test web application in VS2008 (named WebSvcTe

Parser Error Message: Could not create type 'Service'.


My web service works fine on my local machine but when i put it on the server it throw this error:

Parser Error Message: Could not create type 'Service'.

I don't know how to fix this.

Getting error "The XML element 'EnableTheming' from namespace...." When running Web service


Hi everybody i am getting an error

The XML element 'EnableTheming' from namespace 'http://tempuri.org/' is already present in the current scope. Use XML attributes to specify another XML name or namespace for the element.

when i am running my webservice There is no error at build time its build up successfully.

I an getting this error when i return an asp.net pannel from my web method.. but when i am returning simple string its work fine..

Thnks in advance,


Type or namespace membership user cannot be found


- I started an empty ASP.NET 3.5 website

- I included the assembly reference <add assembly="System.Web.ApplicationServices, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

- I included using System.Web.Security;

- I want to use the following code to add a confirmation code to an email

protected void CreateUserWizard1_SendingMail(object sender, MailMessageEventArgs e)
        MembershipUser user = Membership.GetUser(CreateUserWizard1.UserName);
        string code = user.ProviderUserKey.ToString();
        e.Message.Body = e.Message.Body.Replace("<%ConfirmationCode%>", code);

- I know some changes were made to the location of MembershipUser according to this --> http://www.asp.net/(S(ywiyuluxr3qb2dfva1z5lgeg))/learn/whitepapers/aspnet4/breaking-changes#0.1__Toc256770156

Please help!

"The type or namespace name 'List' could not be found"

Hi all,

I'm working through the C# version of ScottGu's Visual Studio 2005 Web Application Project Tutorials <http://webproject.scottgu.com/CSharp/Data/Data.aspx> and am stuck on the Publisher class. After adding the Author list then trying to compile, I get the following error:

...My Documents\Computing\Programming\C#\scottgu\tut1\tut1\Publisher.cs(15,16): The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)

Any suggestions?



I'm running WinXP Pro 2002 w/ SP2 and am developing under Visual Studio 2005 Version 8.0.50727.42 using .Net Framework Version 2.050727 (I have installed a C# update and think I'm running C# 3)

Microsoft Visual Studio Pro 2005 Version 8.0.50727.42  (RTM.050727-4200)
Microsoft .NET Framework Version 2.0.50727

Microsoft Visual C# 2005  

Microsoft Visual Web Developer 2005  

Microsoft Web Application Projects 2005 Version 8.0.60504.00

Microsoft .NET LINQ Preview
Update for Microsoft Visual Studio 2005 Professional Edition - ENU (KB915364)  

Error 2 Type or namespace definition, or end-of-file expected


Hi frnds,

I am new to this programming.. I am trying to download files from a specific folder in ftp server. after downloading those files i want to store in my computer. . I got the code on internet but wen i am trying i am getting this error Error 2 Type or namespace definition, or end-of-file expected. .  please help me very urgent. here is my complete code


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Net;
using System.Text;
using System.Runtime.InteropServices;

public partial class _Default : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e)
        string[] files = GetFileList();
        foreach (string file in files)

        public string[] GetFileList()
            string[] downloadFiles;
            StringBuilder result = new StringBuilder();
            WebResponse response = null;
            StreamReader reader = null;
                FtpWebRequest reqFTP;
                reqFTP = (FtpWebReq

The type or namespace name 'ReportExecutionService' could not be found


I am trying to setup a Web Service Proxy as per the walkthrough in  http://msdn.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx   when i get to ad the line ReportExecutionService rs = new ReportExecutionService(); i get the error "type or name space not found ..." i can add the web service reference and see methods but not all of them  including the class ReportExecutionService.

Any help woule be good.

Error trying to extend a class, The type or namespace name 'ErrorData' does not exist in the names


I would like to create a class that extends my ErrorData class, i have not done this in a while and when i try    class ErrorDataASPX : ExceptionHandler.ErrorData and build i get msg:

Error 1 The type or namespace name 'ErrorData' does not exist in the namespace 'ExceptionHandler' (are you missing an assembly reference?) C:\ExceptionHandling\ExceptionHandler\ErrorDataASPX.cs 9 44 ExceptionHandler

namespace ExceptionHandler
    class ErrorDataASPX : ExceptionHandler.ErrorData

namespace ExceptionHandling
    using System;
    using System.Globalization;
    using System.Text;
    using System.Web;

    /// <summary>
    /// Contains information about an error.
    /// </summary>
    public class ErrorData

Crawl Error - Error in the Site Data Web Service. (Exception of type 'System.OutOfMemoryException'


I have a Sharepoint site that includes a WIki library.  Recently searches have stopped returning any hits from the Wiki pages.  (Search hits from documents and discussions are correctly returned.)  When I check the crawl log from Shared Services Admin site, I see the following error every time a crawl is performed:



Error in the Site Data Web Service. (Exception of type 'System.OutOfMemoryException' was thrown.)


The URL above is part of the Wiki library.  When I look at the raw Sharepoint logs, I see the following entries every time a crawl is performed:


11/26/2007 05:01:50.93  mssdmn.exe (0x1F98)                      0x1368 Search Server Common           MS Search Indexing             7hp2 Monitorable EnumerateListFolder fail. error 2147755542, strWebUrl http://cao.tfn.com/Caopedia, strListName {e9acf8e9-f23f-4afd-b8e9-6eaf6b0101db}, strFolder  
11/26/2007 05:01:50.93  mssdmn.exe (0x1F98)                      0x1368 Search Server Com

Handling 404 page not found with Error page



      How do i handle 404 page not found?

urlrouting - page not found error


I have a dynamic data site setup and running locally fine from vs 2008.

When i deploy to a remote windows 2003 server (IIS6), all the pages also work ok apart from one page/table.  I can access it's list page,  but the edit and insert pages throw 404 errors.

I'm thinking it's a url routing/hosting issue as i've copied back the database from the remote server and it all works fine on my local machine.

Is there anything i can do to debug this behaviour?

Below is my register routes entry from the global.asax

Any suggestions greatly appreciated as, i've been stuck on this for days :(

public static void RegisterRoutes(RouteCollection routes)
    MetaModel model = new MetaModel();
    model.FieldTemplateFactory = new AdvancedFieldTemplateFactory();

    model.RegisterContext(typeof(Sponsorship.Data.Entities), new ContextConfiguration() { ScaffoldAllTables = false });
    model.DynamicDataFolderVirtualPath = "~/admin/DynamicData";

    routes.Add(new DynamicDataRoute("admin/{table}/{action}.aspx")
        Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),

Activation error occured while trying to get instance of type Database, key "DBName"


Im using Enterprise library 5.0
I have a scenario, where I have to access two different databases in my application.

Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.

Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.

<dataConfiguration defaultDatabase="MYCON1" />
<add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"

" />
<add name="MYCON2" connectionString="Data Source=Server2;Initial Catalog=dbName2;User Id=Username2;Password=password2;"
providerName="System.Data.SqlClient" />

Database myDB=EnterpriseLibraryContainer.Current.GetInstance<Database>(); --> works fine for the default database (MYCON1)

Database myDB=EnterpriseLibraryCo

"Type ASP.x is not defined" error for dynamic user control when publishing updateable


I have a user control (ContainerCtrl) which programmatically instantiates another user control (SimpleCtrl) in OnLoad. It builds and runs fine, but when I publish it I get the error "error BC30002: Type 'ASP.SimpleCtrl' is not defined." (If I publish without the "updateable" option there's no error, but I need the site to be updateable.)

I assume this has to do with the particulars of how the assembly(ies) are built for the different compiler options. My question is, how can I get it to work properly for "updateable" publishing?

VS 2008 / .NET 3.5 sp1

The code follows (web.config is the default from Visual Studio).

Many thanks, Dave


<%@ Control Language="VB" ClassName="SimpleCtrl" CodeFile="SimpleCtrl.ascx.vb" Inherits="_SimpleCtrl" %>

    Simple control


Partial Class _SimpleCtrl
    Inherits UserControl

    'Nothing to see here.

End Class


<%@ Control Language="VB" CodeFile="ContainerCtrl.ascx.vb" Inherits="_ContainerCtrl"

DirectoryEntry type not found


 Can someone tell me why the system does not recognize DirectoryEntry in the code below?  It indicates DirectoryEntry cannot be found. 

using System;
using System.Collections;
using System.Collections.Generic;
using System.DirectoryServices;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.DirectoryServices.AccountManagement;

public partial class MyADGroups : System.Web.UI.Page

       public static ArrayList getuserattributes(string objectDn) 
        DirectoryEntry objRootDSE = new DirectoryEntry("LDAP://" + objectDn);
        ArrayList props = new ArrayList();
        foreach (string strAttrName in objRootDSE.Properties.PropertyNames)
        return props;



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend