SharePoint下自定义WFC服务

同事忙不过来,呼叫我支援做一个关于项目的展现页面,项目可以嵌套。

打算采用js + 服务模式做。

为什么采取这种模式,

原因之一,第三方的数据库,不是SharePoint列表,

第二,POC这种修改比较平凡的东西,做好服务后,就可以采取前端模板随意玩。

至于前端模板,可以用backbone, Angular这种等,也可以采用Jquery插件, easyui这种,还可以 react,jsrender这种轻量级的View。

然后兴致勃勃的开始了,一开始发现,

What? 数据库没有主键 , 大家也知道 EF这玩意,主键不能没有,于是挨个加上。

加上以后,就开始玩了,具体可以参考

http://www.cnblogs.com/jianyus/p/3586004.html,

http://www.bianceng.cn/web/sharepoint/201407/42782.htm

核心

1. Svc文件配置 Factory="Microsoft.SharePoint.Client.Services.MultipleBaseAddressWebServiceHostFactory,Microsoft.SharePoint.Client.ServerRuntime,Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"

2. 修改csproj文件,让支持程序集标签替换,我修改了并没有效果

  是自己手动获得程序集信息,核心是怎么获得 sn,vs自带命令 SN -T path

最后的格式是这样的 Service="GDService.GD.GDProject,GDService,Version=1.0.0.0,Culture=neutral,PublicKeyToken=b74d30e5f798d772" 

这都OK了,然后发布了,然后就是没有然后了,不报错,查看log日志, 

最有用的就是 Parent No,尼玛,这是什么,于是于是。。。。。。。

不知道,怎么就记得咋地就查啊查啊,FQ啊等等

两个程序集不会被包含到 wsp解决方案,

参考https://msdn.microsoft.com/en-us/library/ee231595.aspx

选择好source path(也就是程序集dll文件后,直接点击OK)

To add an existing assembly

  1. Open the Package Designer. For more information, see How to: Customize a SharePoint Solution Package.
  2. Choose the Advanced tab.
  3. Choose the Add button, and then choose Add Existing Assembly from the list.

The Add Existing Assembly dialog box appears.

  1. Choose the ellipsis (), and then choose the assembly that you want to add. We recommend using a relative path to the selected assembly for portability purposes.

For the Deployment Target, choose the GlobalAssemblyCache option button to deploy the assembly to the global assembly cache, or choose the WebApplication option button to deploy the assembly to the WebApplication folder on the server that's running SharePoint

于是,终于解决了,汗,一直流汗。

总结起来就是点:

1. svc的配置

2. 程序集打包,EF相关的两个

哦啦啦啦,希望大家有用。

 

你可能感兴趣的:(SharePoint下自定义WFC服务)