Я создал пакетное задание, работающее в 32-битном режиме, так как оно использует 32-битные объекты COM, необходимо подключиться к SharePoint, чтобы внести изменения в список.
Он работает в моей среде разработки, поскольку он полностью 32-битный. Но в моей тестовой и производственной среде мы используем 64-битную версию SharePoint, и вот что я получаю от 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...
это то, что я делаю
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);
}
}
}