这是缓存问题吗?或者什么?

发布于 2024-08-21 20:00:18 字数 1431 浏览 9 评论 0原文

我使用此处找到的模板为 Sharepoint 创建了一个简单的自定义计时器作业: http://saftsack.fs.uni-bayreuth.de/~dun3/archives/visual-studio-2005-project -template-for-sharepoint-2007-timer-jobs/142.html

我已经成功部署并激活了timerJob。然后我决定在作业中添加几行代码,看看是否可以测试我的代码。

我已经使用这些命令来卸载我的timerJob:

Stsadm.exe -o deactivatefeature -filename "\WeeklyDigestJob\feature.xml" -url http:/
/vmsrv28:8080/sites/MySite
STSADM -o uninstallfeature -name "WeeklyDigestJob" -force
STSADM -o retractsolution -name WeeklyDigestJob.wsp -immediate
STSADM -o execadmsvcjobs
STSADM -o deletesolution -name WeeklyDigestJob.wsp -override

然后我检查了文件夹C:\Windows\ assembly,我的DLL 并不像我预期的那样存在。之后,我从 Visual Studio 2008 项目文件夹中删除了所有生成的二进制文件(DLL、WSP 文件等)并重建了解决方案。然后我使用相同的 setup.bat 文件来安装我的计时器作业并开始等待。

一分钟后(上一个构建中的计划为 2 分钟,所以我看到安装程序类运行正常,因为我将其从 2 分钟更改为 1 分钟)并且我的计时器作业执行了。我对执行代码的更改没有显示任何效果。

我的初始代码是:

SPListItem newTask = taskList.Items.Add();
string r = DateTime.Now.ToString();
newTask["Title"] = r;
newTask.Update();

更新的代码:

SPListItem newTask = taskList.Items.Add();
string r = DateTime.Now.ToString() + "New DLL";
newTask["Title"] = r;
newTask.Update();

但是我在新添加的项目的标题中没有得到任何“New DLL”字符串。

我该如何解决这个问题?谢谢。

I've created a simple custom timer job for Sharepoint by using the template i found here: http://saftsack.fs.uni-bayreuth.de/~dun3/archives/visual-studio-2005-project-template-for-sharepoint-2007-timer-jobs/142.html

I've deployed and activated the timerJob successfully. Then I've decided to add a few lines of code to the job to see whether i can test my code.

I've used those commands to uninstall my timerJob:

Stsadm.exe -o deactivatefeature -filename "\WeeklyDigestJob\feature.xml" -url http:/
/vmsrv28:8080/sites/MySite
STSADM -o uninstallfeature -name "WeeklyDigestJob" -force
STSADM -o retractsolution -name WeeklyDigestJob.wsp -immediate
STSADM -o execadmsvcjobs
STSADM -o deletesolution -name WeeklyDigestJob.wsp -override

Then I've checked the folder C:\Windows\assembly, my DLL was not there as i expected. After that I've deleted all the generated binaries (DLLs, the WSP file etc.) from my Visual Studio 2008 project folder and rebuilded the solution. Then i've used the same setup.bat file to install my timerJob and started to wait.

After a minute (schedule was 2 minutes in the previous build, so i see the installer class ran properly as i changed it from 2 to 1 minute) and my timerJob executed. My changes in the execution code didn't show any effect.

My initial code was:

SPListItem newTask = taskList.Items.Add();
string r = DateTime.Now.ToString();
newTask["Title"] = r;
newTask.Update();

Updated Code:

SPListItem newTask = taskList.Items.Add();
string r = DateTime.Now.ToString() + "New DLL";
newTask["Title"] = r;
newTask.Update();

But i didn't get any "New DLL" string in the title of the newly added items.

How can i solve this? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦在深巷 2024-08-28 20:00:18

您是否尝试过重新启动 services.msc 中的计时器服务?我过去发现它喜欢粘在 dll 上直到你重新启动它

此外,值得检查完整的 IISReset 是否也将帮助它拾取 DLL

Have you tried restarting the Timer Service in services.msc? I have found in the past this likes to cling onto the dll until you restart it

Also it is worth checking whether a full IISReset as well will help it pick up the DLL

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文