The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
RSS
Then I get this error:
The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
On web.config I already have this:
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
NOTE: The datacontext is in a different project (DLL proect) where I added a refernce to System.Data.Linq.
is there another way adding a refernce to a web project? or only though teh web.config?
If you can build your projects dll, the problem is not in your dll, that error would come up at compile time on a dll. If the problem is occurring on your front end -- I am assuming it is, I would suggest right clicking on the project and adding the linq
dll references in there, as opposed to directly in the web.config. You will be less prone to error by doing it this way.
If you can build your projects dll, the problem is not in your dll, that error would come up at compile time on a dll. If the problem is occurring on your front end -- I am assuming it is, I would suggest right clicking on the project and adding the linq
dll references in there, as opposed to directly in the web.config. You will be less prone to error by doing it this way.
Thank you for your reply.
Yes. I can compile DLL project. But when compile the web project (that reference to the datacontext DLL) the compilation fails.
Aleady right click on the project and added all the references (system.data.linq) and also added to web.config file.
it keeps insist I don't have a refference and I am out of ideas any more..
NOTE: The datacontext is in a different project (DLL proect) where I added a refernce to System.Data.Linq.
is there another way adding a refernce to a web project? or only though teh web.config?
That seems strange since you've added the reference in web.config. But in the website where the DLL is refered, do you add the reference to System.Data.Linq? If not, please try to add it first.
Thanks.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Maybe this is not enough adding a refference in the web.config file...? is there another adding refferences to web projects?
It's not suggested to add the reference in web.config file manually. You'd better to right click on the website, and choose "Add Reference". Then, add the reference of "System.Data.Linq". Please try it again.
Thanks.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
OK, here is what I done. I remove th web.config line, and added as you suggested. the error is still the same. after adding again the line to web.config the error still exist. I guess I will have somehow to bypass this issue.
megetron
Member
520 Points
921 Posts
The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You mus...
May 28, 2010 01:32 AM|LINK
Hi,
This is frustrating, and I don't know how to solve it.
I have a strange problem. I am adding a LinqDatasource object, and set the context:
protected void LinqDataSource_ContextCreating(object sender, LinqDataSourceContextEventArgs e) { e.ObjectInstance = new KaruselaDataContext(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); }Then I get this error:
The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
On web.config I already have this:
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
NOTE: The datacontext is in a different project (DLL proect) where I added a refernce to System.Data.Linq.
is there another way adding a refernce to a web project? or only though teh web.config?
Thanks.
jasonjanofsk...
Participant
1022 Points
213 Posts
Re: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You...
May 28, 2010 03:55 AM|LINK
If you can build your projects dll, the problem is not in your dll, that error would come up at compile time on a dll. If the problem is occurring on your front end -- I am assuming it is, I would suggest right clicking on the project and adding the linq dll references in there, as opposed to directly in the web.config. You will be less prone to error by doing it this way.
megetron
Member
520 Points
921 Posts
Re: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You...
May 28, 2010 02:16 PM|LINK
Thank you for your reply.
Yes. I can compile DLL project. But when compile the web project (that reference to the datacontext DLL) the compilation fails.
Aleady right click on the project and added all the references (system.data.linq) and also added to web.config file.
it keeps insist I don't have a refference and I am out of ideas any more..
ifta
Member
2 Points
1 Post
Re: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You...
May 29, 2010 02:32 PM|LINK
Hi,
I also have the same problem and it solved by following the solution from this link. chek it out!
http://naturalprogression.wordpress.com/2009/08/07/system-data-linq-datacontext-is-defined-in-an-assembly-that-is-not-referenced/
hope this can help :)
Wencui Qian ...
All-Star
56784 Points
5796 Posts
Microsoft
Re: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You...
May 31, 2010 01:57 AM|LINK
Are you using VS2010? Have you tried to use the version 3.5.0.0 of System.Data.Linq? Please try it first.
Thanks.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
megetron
Member
520 Points
921 Posts
Re: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You...
May 31, 2010 10:26 PM|LINK
I did. the same error. using VS2010.
Wencui Qian ...
All-Star
56784 Points
5796 Posts
Microsoft
Re: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You...
Jun 01, 2010 01:55 AM|LINK
That seems strange since you've added the reference in web.config. But in the website where the DLL is refered, do you add the reference to System.Data.Linq? If not, please try to add it first.
Thanks.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
megetron
Member
520 Points
921 Posts
Re: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You...
Jun 01, 2010 03:37 AM|LINK
Yes
I added this already....this one is very strange....
Maybe this is not enough adding a refference in the web.config file...? is there another adding refferences to web projects?
please note, that the DLL does compiled, and so, the problem is not whithin the DLL file...
Wencui Qian ...
All-Star
56784 Points
5796 Posts
Microsoft
Re: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You...
Jun 01, 2010 05:05 AM|LINK
It's not suggested to add the reference in web.config file manually. You'd better to right click on the website, and choose "Add Reference". Then, add the reference of "System.Data.Linq". Please try it again.
Thanks.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
megetron
Member
520 Points
921 Posts
Re: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You...
Jun 01, 2010 08:40 AM|LINK
OK, here is what I done. I remove th web.config line, and added as you suggested. the error is still the same. after adding again the line to web.config the error still exist. I guess I will have somehow to bypass this issue.