views:

428

answers:

5

Hi, I am running VS2008 in .net 3.5 and trying to get SubSonic 2.2 running. My database is called Test, the table in the DB is called TestTable. It is being run on SQL Server 2005. I get the following "warnings":

Could not find schema information for the element 'SubSonicService'.

Could not find schema information for the attribute 'defaultProvider'.

Could not find schema information for the element 'providers'.

Could not find schema information for the element 'clear'.

Could not find schema information for the element 'add'.

Could not find schema information for the attribute 'name'.

Could not find schema information for the attribute 'type'.

Could not find schema information for the attribute 'connectionStringName'.

Could not find schema information for the attribute 'generatedNameSpace'.

The problem is that the namespace is not being generated so I cannot get much working. The line "SubSonic.Generated.Tables" will bring up in the intellisence the name of my table, so I know that it can connect and it is obviously doing SOMETHING. But I cannot reference my tables like classes. Below I have included the section of the web.config that the "warnings" reference.

<SubSonicService defaultProvider="GeekPower">
    <providers>
      <clear/>
      <add name="GeekPower" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="GeekPower" generatedNameSpace="GeekPower" />
    </providers>    
  </SubSonicService>

Any help would be appreciated. I have been searching for hours, but no fixes that I have found work and I am just going in circles now.

Thanks!

A: 

Do you have any classes in the project that create a namespace conflict with the generating classes? Try regenerating with a different namespace like GeekPower.Foo.

Wayne Hartman
It is a brand new website, so there are no classes. But I tried that and I get the same warnings and still no namespace is generated.
A: 

You may want to see:

Especially, if you are just getting started.

Good luck!

Mark Brittingham
I used subsonic quite extensively for sometime, but it was always from a base application which had it all set up. I watched the setup video and followed it to the letter and I still get the same issues.
A: 

Have you actually generated the classes with the sonic.exe program? That will generate the .cs files that you then import into the project. To get rid of the warnings, add this to the top of your .config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"&gt;
  <configSections>
    <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false" />
  </configSections>
</configuration>
Jason
No, when I used it before it generated the classes for me on the fly. I tried adding the xmlns at the top but it just created more warnings and caused some errors
A: 

Those warnings are because the XML doesn't recognize the config like Jason was saying. You can ignore them - or you can set the configuration to .NetConfiguration/v3.5

Rob Conery
A: 

Hmm. Sorry to reopen this one guys, but I think we can nail it and it doesn't appear to have been nailed yet.

I have exactly the same issue with the warnings, and pretty much exactly the same config. My DAL works perfectly, builds, there is nothing wrong in broad terms, but I get the warnings in every project I have ever used SubSonic for. It's an irritation, nothing more, but an irritation I'd love to get rid of.

If I add

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"&gt;

or v3.5, to the config as suggested, I just get extra messages

Message 1 Could not find schema information for the element 'http://schemas.microsoft.com/.NetConfiguration/v2.0:configuration'

or similar, so that doesn't seem to be the problem. It's not the config file per se, only the SubSonicService section.

The original messages seem reasonable - there should be some file (XML Schema ?) which tells VS the tags which are allowed in the SubSonicService section, and would presumably give us some much needed intellisense too. This file appears to be missing. Is this just a case of 'can't be bothered' ? (Rob ? - no humbug by the way, we've all been there !) If so, can anyone point me at a reasonably simple set of instructions on how to create the file and apply it, and I'll do so and share it.

Ben McIntyre