如何使用 Entity Framework witk Sharepoint 自定义计时器作业?
我开发了一个 SharePoint 自定义计时器作业,它通过实体框架到达 SQL Server。因此,通常 EF 使用 SharePoint 应用程序的 web.config AppSettings 来获取所需的 ConnectionString。但是,在这种情况下,自定义计时器作业通过 EF 到达 SQL Server,它给了我
在配置中找不到指定的命名连接、不适合与 EntityClient 提供程序一起使用或无效。
很明显,它无法从配置中读取 ConnectionString 值。
问题:
你们知道这个 SharePoint 客户计时器作业的配置文件在哪里吗? SharePoint 管理应用程序 web.config?机器配置?功能的Feature.xml?
如果它没有从配置文件中读取此信息,我应该如何访问 EF 的 ConnectionString?使用自定义计时器作业的属性来保存 ConnectionString 信息?
I developed a SharePoint Custom Timer Job which reaches SQL Server by Entity Framework. So normally EF uses SharePoint application's web.config AppSettings to get the ConnectionString it needed. But, in this case, where Custom Timer Job reaches SQL Server via EF, it gives me
The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
It is obvious that it can't read ConnectionString value from configuration.
QUESTION:
Do you guys know where is this SharePoint Customer Timer Job's configuration file is?
SharePoint Administration application web.config? machine.config? Feature.xml of Feature?
If it doesn't read this info from a config file, what should I do to access ConnectionString of EF? Use properties of Custom Timer Job to persist ConnectionString information?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SP作业定时器由SP定时器作业窗口服务执行。该 exe 是位于 bin 文件夹中的 Owstimer.exe。您可以添加或创建 Owtimer.exe.config,以便您的自定义作业可以从中读取。
SP job timer is executed by the SP timer job window service. The exe is Owstimer.exe located in the bin folder. You can add to or created Owstimer.exe.config so that your custom job can read from it.
计时器作业不由 Web 应用程序托管。它在单独的进程中运行 - owstimer.exe。在服务器上找到该文件,然后创建 owstimer.exe.config 文件(如果不存在)并将必要的配置放置到该文件中。
Timer job is not hosted by web application. It is running in separate process - owstimer.exe. Locate the file on your server and simply create owstimer.exe.config file (if it doesn't exists) and place necessary configuration to that file.