No vendor defined named evanmoor_sales
I am getting this error when I try to launch my login page. Here's my stack trace:
[ArgumentException: No provider is defined with the name evanmoor_sales
Parameter name: providerName]
SubSonic.DataService.GetInstance(String providerName) in C:\svn\subsonicproject\trunk\SubSonic\DataProviders\DataService.cs:163
Emcom.Sales.SalesUser.GetTableSchema() in C:\work\2007.evan-moor.com\Sales.DataAccess.Generated\Generated\SalesUser.cs:123
Emcom.Sales.SalesUser.SetSQLProps() in C:\work\2007.evan-moor.com\Sales.DataAccess.Generated\Generated\SalesUser.cs:102
Emcom.Sales.SalesUser..ctor() in C:\work\2007.evan-moor.com\Sales.DataAccess.Generated\Generated\SalesUser.cs:73
salesreps_Login.SalesRepLogin(Object sender, EventArgs e) in c:\web\sites\dev.evan-moor.com\salesreps\salesreplogin.aspx.cs:25
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
And here is the vendor section of my web.config file:
<SubSonicService defaultProvider="evanmoor_web">
<providers>
<clear/>
<add name="evanmoor_web" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="evanmoor_web" generatedNamespace="Emcom"/>
<add name="evanmoor_standards" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="evanmoor_standards" generatedNamespace="Ts"/>
<add name="evanmoor_sales" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="evanmoor_sales" generatedNamespace="Emcom.Sales"/>
</providers>
</SubSonicService>
Any suggestions? I am using SubSonic 2.1.0, so it should be the latest version.
I ran into this for a different reason too, and it took a few searches to root the issue, so I thought I'd share my solution.
I set my web.config with defaultprovider = provider1 and then you needed to translate it to provider2. I replaced all instances of provider1 in all my files and ran the application but hit this error and of course namespace1 appeared in the details of the error message so explicitly finding and replacing in Visual Studio was not enough.
In the end, I had to delete the myClass.xml files that Studio created in the \ bin and \ obj \ debug files. They did not recover despite cleaning and repairing the solution, and they still contained links to the old installation.
source to share