简体   繁体   English

我正在尝试将SPMETAL生成的模型类与Sharepoint 2016一起使用,在Microsoft.Sharepoint.Linq上遇到错误

[英]I am trying to use SPMETAL generated model classes with Sharepoint 2016, getting errors on Microsoft.Sharepoint.Linq

After running SPMETAL.exe against my Sharepoint 2016 site, I imported the generated model to my project. 在我的Sharepoint 2016网站上运行SPMETAL.exe之后,我将生成的模型导入到我的项目中。 I get 263 errors of the type "The type or namespace name 'Linq' does not exist in the namespace 'Microsoft.Sharepoint' (are you missing an assembly reference?). 我收到类型为263的错误“名称空间'Microsoft.Sharepoint'中不存在类型或名称空间名称'Linq'(您是否缺少程序集引用?)。

By the way, in order to generate a datacontext model from your Sharepoint site for use with Linq to SQL with SPMETAL.exe, here's the command: "C:\\Program Files\\Common Files\\Microsoft Shared\\Web Server Extensions\\16\\BIN\\SPMETAL.exe" /web: /namespace: /code: Change the "16" above, depending on the version of Sharepoint you have / which folder you have there. 顺便说一句,为了从您的Sharepoint站点生成数据上下文模型以与SPMETAL.exe一起用于Linq to SQL,请使用以下命令:“ C:\\ Program Files \\ Common Files \\ Microsoft Shared \\ Web服务器扩展\\ 16 \\ BIN \\ SPMETAL.exe“ / web:/ namespace:/ code:更改上面的” 16“,具体取决于您拥有的Sharepoint的版本/那里的文件夹。

I have already referenced Microsoft.SharePoint.dll and installed the client and client runtime using Nuget. 我已经引用了Microsoft.SharePoint.dll,并使用Nuget安装了客户端和客户端运行时。

Did something major change and can I still use SPMETAL? 发生了重大变化,我是否仍可以使用SPMETAL? I've done a ton of searches, but other namespaces with Linq show up and I still haven't found what assembly or package Microsoft.Sharepoint.Linq resides in. 我已经进行了大量搜索,但是出现了带有Linq的其他名称空间,但我仍然没有找到Microsoft.Sharepoint.Linq驻留在哪个程序集或程序包中。

After Googling quite a bit, I found a reference to the assembly the Microsoft.Sharepoint.Linq namespace is located within: "Microsoft.Sharepoint.Linq.dll". 仔细搜索之后,我找到了对Microsoft.Sharepoint.Linq命名空间位于的程序集的引用:“ Microsoft.Sharepoint.Linq.dll”。 I did a file search for that and found it in the .NET install, assemblies subfolder: C:\\Windows\\Microsoft.NET\\assembly\\GAC_MSIL\\Microsoft.SharePoint.Linq\\v4.0_16.0.0.0__71e9bce111e9429c\\ 我进行了文件搜索,并在.NET安装,程序集子文件夹中找到它:C:\\ Windows \\ Microsoft.NET \\ assembly \\ GAC_MSIL \\ Microsoft.SharePoint.Linq \\ v4.0_16.0.0.0__71e9bce111e9429c \\

I included a reference to that in my project and all the errors went away. 我在项目中加入了对它的引用,所有错误都消失了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在尝试在Web部件中使用SharePoint ITransformableFilterValues多个值 - I am trying to use the SharePoint ITransformableFilterValues multiple values in web part 我正在尝试在sharepoint中搜索文件 - I am trying to search for a file in sharepoint 尝试调用共享点列表服务时获取“ Microsoft.SharePoint.SoapServer.SoapServerException” - Getting 'Microsoft.SharePoint.SoapServer.SoapServerException' when trying to call sharepoint Lists Service I am trying to access sharepoint via C# code and i am getting UNAUTHORIZED access error but I can log web sharepoint without any issues - I am trying to access sharepoint via C# code and i am getting UNAUTHORIZED access error but I can log web sharepoint without any issues 我收到一条错误消息,显示“不支持给定路径的格式”。 尝试将音频文件上传到 sharepoint - I am getting an error that reads “The given path's format is not supported.” when trying to upload audio file to sharepoint SharePoint 2016 FileNotFound 异常 - SharePoint 2016 FileNotFound Exception 共享点错误 - Sharepoint errors Linq to SQL:为什么我收到IDENTITY_INSERT错误? - Linq to SQL: Why am I getting IDENTITY_INSERT errors? 我正在尝试在数据表中添加Linq结果,但出现错误 - I am trying to add Linq result in Datatable but getting Error 我正在尝试更新 sharepoint 列表中的项目,但它返回错误请求 .NET 核心 - I am trying to update an item in a sharepoint list but its returning Bad Request .NET core
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM