views:

77

answers:

3

I'm getting very odd errors when compiling our Data Access library (all subsonic). Errors are

Error 35 The type name 'Web' does not exist in the type 'S3.DACL.System'    
      C:\Projects\S3\src\DACL\AspnetUser.cs 369 63 DACL

And

Error 37 The type name 'ComponentModel' does not exist in the type 
 'S3.DACL.System' 
C:\Projects\S3\src\DACL\AspnetPersonalizationPerUserController.cs 19 13 DACL

and they are on all of my subsonic generated classes.

I've got 2 projects -- a Web project and then a class library called DACL. My web.config subsonic stuff is like this:

<connectionStrings>
  <add name="S3" connectionString="data source=ServerName;initial catalog=Cat1;
         user id=usenrame;password=password;" />
</connectionStrings>
<SubSonicService defaultProvider="S3">
  <providers>
    <add name="S3" type="SubSonic.SqlDataProvider, SubSonic" 
       connectionStringName="S3" generatedNamespace="S3.DACL"/>
  </providers>
</SubSonicService>

I had these error earlier tonight, but that was due to a type of the default provider parameter.

Anyone have any ideas why I am getting these errors? I'm desparate and have been banging my head against a wall for the last hour.

+3  A: 

Subsonic uses System.Web namespace. So please add reference to System.Web other namespaces to your projects.

TheVillageIdiot
I've got that. System.Web, System.configuration, System.Data, System.Data.DataSetExtesions, System.XML, System.Xml.Linq, System.Core... I still don't know why this is happening.
Matt Dawdy
Have you added them to your DAL project also?
TheVillageIdiot
+3  A: 

You may also need to add a reference to the System.configuration name space if you haven't already.

Joe
I've got that one, too. System.Web, System.configuration, System.Data, System.Data.DataSetExtesions, System.XML, System.Xml.Linq, System.Core... I still don't know why this is happening.
Matt Dawdy
+2  A: 

The problem ended up being this: some genius (actually he is pretty smart, he just had a brain fart) was adding tables to the DB (I knew he was doing this). However, I did NOT know that he added a table named "System". Well, that got Subsonic all confused because it made a class called "System".

Do NOT do this in your own projects. .Net gets very confused between the System namespace and the class. And no one wins.

After I renamed the table, deleted the System.cs and SystemController.cs files, edited the DACL.csproj file by hand (for some reason it wouldn't remove the references to those 2 classes), closed the solution and recompiled, FINALLY it all started working again.

This is added to my own list of "is it plugged in" stupid things to look for before I go looking for exotic solutions.

Thanks for the advice, TheVillageIdiot and Joe. Your suggestions are still very worthwhile to check.

Matt Dawdy
Thank you, that was it!
AlexanderN