Link to home
Start Free TrialLog in
Avatar of ChrisJonesLycos
ChrisJonesLycos

asked on

Web Visual Developer 2010 doesn't recognise namespace System.Data

I've installed Web Visual Developer 2010 Beta plus Silverlight SDK and Tools and have started a Silverlight app in C#. All has been fine up to now but now I'm starting with the DB section it doesn't recognise namespace System.Data

The error is:
The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?)
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

1) The RTM version should be available, now that 2010 was released yesterday.

2) Usually, when you can't find a namespace, it is because there isn't a reference to the .dll added to the project.  You should be able to "Add Reference", and select the System.Data.dll, and then be able to use that namespace.
Avatar of ChrisJonesLycos
ChrisJonesLycos

ASKER

Have you any idea where the System.Data.dll is located? I can find only one and it is in a very obscure folder.
System.Data should be in the Global Assembly Cache (GAC), and should be available in the "Add Reference" dialog.
Unfortunately it's not there then. Could it be that either VWD 10 or VWD 10 no longer use this namespace. I've noticed lots of differences between VWD 10 and the examples I'm following in VWD 8. But this seems pretty fundamental.
[Corrected] Unfortunately it's not there then. Could it be that either VWD 10 or VWD 10 beta no longer use this namespace? I've noticed lots of differences between VWD 10 and the examples I'm following in VWD 8. But this seems pretty fundamental.
System.Data.dll is a crucial part of the .NET framework, so it should be there.  The root for the file stored in the GAC is %SystemRoot%\Microsoft.NET\Framework\v4.0.30319.

Here is an attached image of the files in that folder, with System.Data.dll highlighted.  BTW, I don't have Visual Web Developer (I have VS.NET Ultimate RTM version, which includes that piece), but that shouldn't matter with this particular DLL.


Screenshot.png
Thought to see whats going on...so I created an silverlightApplication in VWD2010(RTM)...and tried to add a reference to System.Data but it is no longer under .NET tab..i.e. GAC....So I went to my gac folder
C:\Windows\assembly and none  of the 4.0 assemblies are listed there...

As TheLearnedOne: suggested I went to main root C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 and it was there. But unfortunately I wasn't able to add System.Data dll....

This is the first ever Silverlight project I created and for now I don't know how it works...so can't explain what is going on...
Yes, I've basically done the same. System.Data isn't there when you right click, Add Reference in the Solutions box. If I choose to browse to file and go to C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319, find System.Data and try to add it, it says this is the wrong version of .NET Framework. I removed all previous versions of .NET when I installed Silverlight just so I had the version Silverlight specified. So I'm not sure what's going on.

ASKER CERTIFIED SOLUTION
Avatar of ChrisJonesLycos
ChrisJonesLycos

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't work with Silverlight enough, yet, to know that one, but I guess that I have learned it now.  I don't know of any web site where that would be explained.