locked
The type or namespace name 'Data' does not exist in the namespace 'WebMatrix' (are you missing an assembly reference?) RRS feed

  • Question

  • User-1080297099 posted

    Can somebody please tell me why I am getting this error?

    I don't think our project is even using WebMatrix. This doen't make any sense.

    When I track down the file in Temporary Internet Files from the error page like:
     c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a0f1dd48\eeb33fb5\App_Web_logon.cshtml.5f83eb8c.rtlw08so.0.cs    Line: 29

    Then I open the file and it says its coming from:
    C:\Projects\*****\trunk\code\*****\Sites\*********\*********.AdminWeb\Views\Account\LogOn.cshtml

    And I see all these using statements:

    using System;
        using System.Collections.Generic;
        using System.IO;
        using System.Linq;
        using System.Net;
        using System.Web;
        using System.Web.Helpers;
        using System.Web.Security;
        using System.Web.UI;
        using System.Web.WebPages;
        using System.Web.Mvc;
        using System.Web.Mvc.Ajax;
        using System.Web.Mvc.Html;
        using System.Web.Optimization;
        using System.Web.Routing;
        using Biothreat.Web.MVC;
        using WebMatrix.Data;
        using WebMatrix.WebData;
        using Microsoft.Web.WebPages.OAuth;
        using DotNetOpenAuth.AspNet;

    The offending statement:
    using WebMatrix.Data;

    So I open up the real Views\Account\LogOn.cshtml in my project, there is no using statement for webmatrix.

    I look in Account controller Login action and none in that controller either.

    So I don't even see how this is getting into the code.
    It is not in my Web.Config in the root or in Views.

    Also I have added the references to WebMatrix.Data and WebMatrix.WebData just to try and make it happy.

    Just don't understand this.
    What does it mean?
    What does it want?

     

    Tuesday, January 7, 2014 5:34 PM

Answers

  • User281315223 posted

    Have you tried cleaning and rebuilding your application or explicitly clearing our your temporary files / bin folder?

    You mentioned that you added the appropriate DLL references so I can't really think of anything that could cause that error besides some older temporary files that are floating around. You might try restarting your development environment as well to see if that clears any of the issues up.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 7, 2014 5:46 PM
  • User1176121428 posted

    Hi smiller781,

    Thanks for your post.

    According to your description,Based on my konwledge,the WebMatrix.WebData namespace contains classes that simplify membership and security in ASP.NET Web Pages. This namespace includes classes that help you create and delete user accounts, define roles, and manage account passwords.WebSecurity class represents a helper, which is a component that simplifies web programming in ASP.NET Web Pages. The WebSecurity class is the primary means in ASP.NET Web Pages to perform security operations. It exposes the most frequently required security features, such as creating a user account, logging users in and out, getting details about a user, changing a password, and so on

    The type or namespace name 'Data' does not exist in the namespace 'We...

    This error can be fixed by being sure that you have the WebMatrix.WebData inside your references. This assembly should be located in Asp.Net Web Page folder of Microsoft Asp.Net (c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\WebMatrix.Data.dll). The best way to get the reference is simply to click Add Reference and doing a search for WebMatrix.Once you are sure your have the WebMatrix DLL, be sure that this one have the property “Copy Local” to true.

    More information:

    WebSecurity Class

    WebMatrix.WebData Namespace

    Hope this helps you.

    Best Regards,

    Eileen

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 9, 2014 2:03 AM
  • User1243880387 posted

    I was facing similar issue, I simply clean and rebuild.

    If problem persisted then I removed refernce and added the same again.

    And it woks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 9, 2014 2:17 AM

All replies

  • User281315223 posted

    Have you tried cleaning and rebuilding your application or explicitly clearing our your temporary files / bin folder?

    You mentioned that you added the appropriate DLL references so I can't really think of anything that could cause that error besides some older temporary files that are floating around. You might try restarting your development environment as well to see if that clears any of the issues up.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 7, 2014 5:46 PM
  • User1176121428 posted

    Hi smiller781,

    Thanks for your post.

    According to your description,Based on my konwledge,the WebMatrix.WebData namespace contains classes that simplify membership and security in ASP.NET Web Pages. This namespace includes classes that help you create and delete user accounts, define roles, and manage account passwords.WebSecurity class represents a helper, which is a component that simplifies web programming in ASP.NET Web Pages. The WebSecurity class is the primary means in ASP.NET Web Pages to perform security operations. It exposes the most frequently required security features, such as creating a user account, logging users in and out, getting details about a user, changing a password, and so on

    The type or namespace name 'Data' does not exist in the namespace 'We...

    This error can be fixed by being sure that you have the WebMatrix.WebData inside your references. This assembly should be located in Asp.Net Web Page folder of Microsoft Asp.Net (c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\WebMatrix.Data.dll). The best way to get the reference is simply to click Add Reference and doing a search for WebMatrix.Once you are sure your have the WebMatrix DLL, be sure that this one have the property “Copy Local” to true.

    More information:

    WebSecurity Class

    WebMatrix.WebData Namespace

    Hope this helps you.

    Best Regards,

    Eileen

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 9, 2014 2:03 AM
  • User1243880387 posted

    I was facing similar issue, I simply clean and rebuild.

    If problem persisted then I removed refernce and added the same again.

    And it woks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 9, 2014 2:17 AM