Tag: sharepoint

SharePoint无法在Windows 2008上加载C ++ DLL

我有一个SharePoint DLL,它可以执行一些许可,并且作为代码的一部分,它使用外部C ++ DLL来获取硬盘的序列号。 当我在Windows Server 2003上运行此应用程序时,它工作正常,但在Windows Server 2008上,整个站点(加载时加载)会不断崩溃和重置。 这不是Windows Server 2008 R2,在64位或32位中是相同的。 如果我在DLL执行之前放置一个Debugger.Break ,那么我会看到代码到达中断点,然后再也不会再回到DLL中。 我确实从函数内部获得了一些调试断言警告,仅在Windows Server 2008中,但我不确定这是否相关。 我创建了一个运行C#DLL的控制台应用程序,后者又加载了C ++ DLL,这在Windows Server 2008上完美运行(虽然它确实显示了断言错误,但我现在已经抑制了这些)。 断言错误不在我的代码中,而是在ICtypes.c ,而不是我可以调试的东西。 如果我在DLL中放置一个断点,它永远不会被命中,编译器说: “step in: Stepping over non user code” 如果我尝试使用Visual Studio调试DLL。 我已经尝试包装用于调用DLL的代码: SPSecurity.RunWithElevatedPrivileges(delegate() 但这也无济于事。 我有这个DLL的源代码,所以这不是一个问题。 如果我从目录中删除DLL,我会收到有关丢失的DLL的错误。 如果我更换它,请回到没有错误或警告完全失败。 如果我用硬编码字符串替换此代码,整个应用程序工作正常。 任何建议都将非常感激,我无法理解为什么它作为控制台应用程序工作,但不是由SharePoint运行。 这是在同一台机器上使用相同的用户帐户… 这是用于调用DLL的代码: [DllImport(“idDll.dll”, EntryPoint = “GetMachineId”, SetLastError = true)] extern static string […]

Sharepoint – 使用列值上载文件无法加载目标中的分类字段

我试图将文件从一个服务器场上的一个文档库传输到另一个服务器场。 由于两者都可以从同一网络访问,我想到从源获取列值并直接将其添加到目标项目中。 还要将文件与项目一起上传。 List list = ccSource.Web.Lists.GetByTitle(“Source Library”); ccSource.ExecuteQuery(); // ccSource is initialized with source Site collection CamlQuery query = new CamlQuery(); ListItemCollection itemCollection = list.GetItems(CamlQuery.CreateAllItemsQuery()); //Query can also be selective ccSource.Load(list); ccSource.Load(itemCollection); ccSource.ExecuteQuery(); ccSource.Load(ccSource.Web); string[] coloumnsList = System.IO.File.ReadAllLines(@”E:\Coloumns.txt”); foreach (ListItem item in itemCollection) { ClientContext ccTarget. = new ClientContext(“http://TargetSC/sites/mysite”); ccTarget.Credentials = new NetworkCredential(“username”, “pass”, […]

Sharepoint“无法加载文件或程序集”“系统找不到指定的文件”

我在我的.net项目中添加了对dll(sharpPDF)的引用。 在代码中,它已经拿起了dll,我可以使用它。 当我通过sharepoint webpart部署时,我收到以下错误: Could not load file or assembly ‘sharpPDF, Version=1.0.3511.18105, Culture=neutral, PublicKeyToken=f099e668beaaa0f9’ or one of its dependencies. The system cannot find the file specified. 我正在使用STSDEV部署webapp。 我已经尝试清除C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ Temporary ASP.NET Files但这不能解决问题。 什么想法可能会出错?

超出存储分配。 服务器响应为:4.3.1邮件大小超过固定的最大邮件大小

我使用SMTPclient发送带附件的邮件。 当附件超过2mb时,我得到以下错误:**“超出存储分配。服务器响应是:4.3.1消息大小超过固定的最大消息大小”。 ** 1)我可以使用附件大小> 2mb的smtpclient发送电子邮件**。 **如果是,附件限制是多少。 2)我如何解决上述错误? 如果你有解决方案,请给我一个想法。

Web.GetFileByServerRelativeUrl抛出“值不在预期范围内”

我有一个SP Online网站,我存储文档,添加/检索文档没有问题,但在删除流程中,我在检索File对象时遇到错误。 public static void DeleteDocument() { using (ClientContext ctx = ClientContextFactory.Create(“http://sofzh.miximages.com/c%23/images.jpg”; File file = web.GetFileByServerRelativeUrl(relativeUrl); ctx.Load(file); file.DeleteObject(); ctx.ExecuteQuery(); } } 该文件的完整文件是“ http://sofzh.miximages.com/c%23/images.jpg ”(无法访问2016-12-07) 当我执行它时,我得到一个ServerException : 价值不在预期范围内。 上下文工作正常,因为我能够从库中添加/检索项目,上下文用户是管理员 。 我尝试将web url添加到relativeUrl,所以它将是“/documentsite/Documents/images.jpg”,但我得到了同样的错误。 我似乎无法弄清楚这一点,有什么建议吗? 谢谢

csharp源代码在哪里使用sharepoint

请在sharepoint中提供csharp区域。 使用什么部分csharp源。 如何在sharepoint中加载文档。 是否可以通过c sharp完成。

Sharepoint客户端对象模型尚未初始化属性或字段

我有一个C#程序,使用Sharepoint客户端对象模型管理Sharepoint列表。 有时我们会遇到服务器问题,这会阻止程序访问sharepoint服务器。 我正在使用一个帮助程序类来运行ExecuteQuery方法并具有exception处理以继续执行,直到没有exception。 private void ExecuteContextQuery(ref ClientContext siteContext) { int timeOut = 10000; int numberOfConnectionErrors = 0; int maxNumberOfRetry = 60; while (numberOfConnectionErrors < maxNumberOfRetry) { try { siteContext.ExecuteQuery(); break; } catch (Exception Ex) { numberOfConnectionErrors++; Service.applicationLog.WriteLine("Unable to connect to the sharepoint site. Retrying in " + timeOut); Service.applicationLog.WriteLine("Exception " + Ex.Message + " " […]

SharePoint:从后面的代码向webpart添加属性

在页面的代码隐藏中。 如何获取页面上存在的webpart,然后使用c#向该webpart添加属性。 webpart存在webpartzone。 我需要对SPWebPartManager做什么吗?

使用CSOM读取Sharepoint中的网站页面内容

在我的项目中,我需要在本地存储网站页面。 这些页面可能是已发布或未发布的页面。 我尝试使用以下代码但无法获取页面内容。 ClientContext clientcontext = new ClientContext(url); var credentials = new SharePointOnlineCredentials(userid, SecurePass); clientcontext.Credentials = credentials; Web web = clientcontext.Web; clientcontext.Load(web, website => website.Lists); clientcontext.ExecuteQuery(); clientcontext.Load(web, website => website.Lists, website => website.Lists.Where( x => x.BaseTemplate == 119)); clientcontext.ExecuteQuery(); var _collection = web.Lists; foreach (var pages in _collection) { clientcontext.Load(pages); clientcontext.ExecuteQuery(); CamlQuery cq = new […]

SharePoint安全validation更新元数据时出现问题(此页面的安全validation无效)

我从aspx.cs调用此方法时出现此错误。 此页面的安全validation无效。 在Web浏览器中单击“上一步”,刷新页面,然后再次尝试操作 //SPUtility.ValidateFormDigest(); // still not working although I added it later //hit the error here **** if I add using (SPSite site = new SPSite(spServerURL)) { using (SPWeb oWebsite = site.OpenWeb()) { SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite elevatedSite = new SPSite(site.ID)) { using (SPWeb elevatedWeb = elevatedSite.OpenWeb(oWebsite.ID)) { if (elevatedWeb.GetFile(DocumentLibraryName + “/” + folderName […]