This project is read-only.

Sequence contains no elements

Sep 22, 2010 at 10:41 AM

I created a new slam.config file for a different site collection but whe I try to activate it give me the Error message "Sequence contains no elements", when  I validate I get the following error message "

System.InvalidOperationException: Sequence contains no elements at System.Linq.Enumerable.First[TSource](IEnumerable`1 source) at AWS.SLAM.Configuration.XmlConnectionStringSection.GetConnectionString(String name) at AWS.SLAM.Configuration.XmlConnectionStringSection.get_Default() at AWS.SLAM.Administration.Configuration.<>c__DisplayClass3.b__0() at Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state) at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.b__2() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) at AWS.SLAM.Administration.Configuration.btnValidateConfiguration_Click(Object sender, EventArgs e).
 
Please advise on how to work around this issue
 
Regards
 
Lee
Developer
Sep 22, 2010 at 1:23 PM

Are you saying you now have two slam configs?  You can only have one slam.config per web application.  What do you see when you validate?

Sep 22, 2010 at 1:28 PM
I only have one slam.config file, what I did was I no longer wanted to slam the site I had created initially so I set up a the slam.config to get point to the new site and have it create tables in a new database altogether. I have retracted the solution and redeployed it but I get the same errors.
Developer
Sep 22, 2010 at 1:31 PM

So all you changed were which lists you were pointing?  What do you get when you use the validate function in the control panel?

Sep 22, 2010 at 1:34 PM
This is the error that I get

System.InvalidOperationException: Sequence contains no elements at System.Linq.Enumerable.First[TSource](IEnumerable`1 source) at AWS.SLAM.Configuration.XmlConnectionStringSection.GetConnectionString(String name) at AWS.SLAM.Configuration.XmlConnectionStringSection.get_Default() at AWS.SLAM.Administration.Configuration.<>c__DisplayClass3.b__0() at Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state) at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.b__2() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) at AWS.SLAM.Administration.Configuration.btnValidateConfiguration_Click(Object sender, EventArgs e)



Developer
Sep 22, 2010 at 1:35 PM

This is the error when you validate, not activate?  Anyway, the error appears to related to your connection string.  My guess is you introduced an error there when you pointed SLAM to the new database.

Sep 22, 2010 at 1:42 PM
You are quite right, I guess sitting and looking at the same piece of code for a while makes you miss something silly. I had put e.g "<ConnectionStrings Default ="xxxxx">
and then on <add Name="xxxxy"..... . I changed it to match and it has worked.

Thanks for your help. I appreciate it.

Great tool this is by the way

Regards

Lee
Developer
Sep 22, 2010 at 1:43 PM

Good stuff!  Enjoy.