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);
}
}
}
source
share