[英]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.