Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9163899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:33:10+00:00 2026-06-17T14:33:10+00:00

In my DataAccess project I have the code: using (TandAEntities dataContext = new TandAEntities())

  • 0

In my DataAccess project I have the code:

using (TandAEntities dataContext = new TandAEntities())
{
    // Some code
}

This gives no error and works fine.

But in my Unit Test project, I have that same code, but the compiler gives an error; type used in a using statement must be implicitly convertible to 'System.IDisposable'

I checked the definition by pressing F12, and it does indeed implement IDisposable, and has a dispose method.

Am I perhaps missing some references?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:33:11+00:00Added an answer on June 17, 2026 at 2:33 pm

    Most likely answer in linked duplicate – missing using System.Data.Linq.

    Other options: you have stale DLLs somewhere (i.e. installed in the GAC).

    If you can’t easily find stale DLL by just looking around and checking GAC – change code to something that uses this type but compiles and debug the test. Check Debug->Windows->Modules for location of the assembly with this type that is actually used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my Fluent NHibernate setup code in a DataAccess project which is accessed
I've been using repositories for data access for some time now but have never
I have developed a project using MVC3 and Code first Entity Framework 4.0 as
I'm working on a huge, old project with a lot of brittle code, some
I have an existing ASP.Net MVC project that is using entities / repositories in
I have the understanding that using data access routines directly from presentation code is
I have recently upgraded my .Net 3.5 solution containing some C# code projects and
I'm putting together a new ASP.NET MVC project and have already designed and build
I have created a code generator for our project to generate a lot of
I have an ASP.NET website project that until recent had all code in App_Code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.