Using SPSite from a 32-bit application to access 64-bit SharePoint

I created a batch job that works in 32-bit mode, because it uses 32-bit COM objects, you need to connect to SharePoint to update the list. It works in my development environment since it is fully 32-bit. But in my testing and prodution environment, we use 64-bit SharePoint, and this is what I get from SPSite:

System.IO.FileNotFoundException: 
  The Web application at http://<my sp host>/ could not be found. 
  Verify that you have typed the URL correctly. 
  If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri req...

that's what I'm doing

        using (SPSite site = new SPSite(_url))
        {
            using (SPWeb web = site.OpenWeb())
            {
                try
                {
                    SPList list = web.Lists[new Guid(_listID)];
                    SPListItem item = list.GetItemById(id);
                    item[field] = value;
                    item.SystemUpdate(false);
                }
                catch (Exception x)
                {
                    log.Error(x);
                }
            }
        }
+3
source share
2 answers

64- . , SharePoint COM- , 64- . SPSite SPWeb COM-, 32- .

SharePoint - .

+6

, 32/64- , , 32- , 64-. ( , 32- 64- WFE'S)

SPSite, , , ( SP), URL.

+1

Source: https://habr.com/ru/post/1698919/


All Articles