I have a virtual machine I use for SharePoint 2010 developement. On this machine I have all rights all permissions. The SQL Server runs there and SharePoint is installed. In this VM I created a Winforms application which reads and handles SharePoint data, mainly list manipulation. It works fine.
The first thing the application does is receiving all list names from a user specified Site-URL via this method:
public static List<String> GetAllListNames(string _siteURL)
{
List<String> listNames = new List<string>();
try
{
using (SPSite site = new SPSite(_siteURL.Trim()))
{
using (SPWeb web = site.OpenWeb())
{
SPListCollection lists = web.Lists;
foreach (SPList l in lists)
{
listNames.Add(l.Title);
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
return listNames;
}
Now I published the applicatio via Click-Once and installed it on another server (Windows Server 2008 R2). This machine also has SharePoint installed on it. I also have full permission for the site I am trying to connect. Still when I try to connect/ get all list names I get the following Error:
Microsoft.SharePoint.SPException ---> System.Runtime.InteropServices.COMException (0x80131904): 0x80131904 bei Microsoft.SharePoint.Library.SPRequestInternalClass.GetListsWithCallback(String bstrUrl, Guid foreignWebId, String bstrListInternalName, Int32 dwBaseType, Int32 dwBaseTypeAlt, Int32 dwServerTemplate, UInt32 dwGetListFlags, UInt32 dwListFilterFlags, Boolean bPrefetchMetaData, Boolean bSecurityTrimmed, Boolean bGetSecurityData, Boolean bPrefetchRelatedFields, ISP2DSafeArrayWriter p2DWriter, Int32& plRecycleBinCount) bei Microsoft.SharePoint.Library.SPRequest.GetListsWithCallback(String bstrUrl, Guid foreignWebId, String bstrListInternalName, Int32 dwBaseType, Int32 dwBaseTypeAlt, Int32 dwServerTemplate, UInt32 dwGetListFlags, UInt32 dwListFilterFlags, Boolean bPrefetchMetaData, Boolean bSecurityTrimmed, Boolean bGetSecurityData, Boolean bPrefetchRelatedFields, ISP2DSafeArrayWriter p2DWriter, Int32& plRecycleBinCount) --- Ende der internen Ausnahmestapelüberwachung --- bei Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
bei Microsoft.SharePoint.Library.SPRequest.GetListsWithCallback(String bstrUrl, Guid foreignWebId, String bstrListInternalName, Int32 dwBaseType, Int32 dwBaseTypeAlt, Int32 dwServerTemplate, UInt32 dwGetListFlags, UInt32 dwListFilterFlags, Boolean bPrefetchMetaData, Boolean bSecurityTrimmed, Boolean bGetSecurityData, Boolean bPrefetchRelatedFields, ISP2DSafeArrayWriter p2DWriter, Int32& plRecycleBinCount) bei Microsoft.SharePoint.SPListCollection.EnsureListsData(Guid webId, String strListName) bei Microsoft.SharePoint.SPListCollection.Undirty() bei Microsoft.SharePoint.SPBaseCollection.GetEnumerator() bei MPToolBoxServerSide.SharePoint.SPAdapter.GetAllListNames(String _siteURL)
I tried to look up (0x80131904) on the web. SQL Content-DB's Log becoming to big seems often to be the reason for this issue. In my case it is not.
Also when I tried to install the application previously I had an issue with Interop not being installed in the GAC on the second server so I removed all (Interop) references from the project as it still compiles and works fine on my developement machine.
So is it possible that the application simply still misses some .dll but the Exception ctached is not detailed enough? Or is there something els.e I missed?
Btw if I try to execute the very same method using CSOM I can access data without any problems even when the application is not installed on the server but on a Client machine.
Thanks in advance!