本文介绍了Sharepoint Wsp部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经开发了解决方案,也创建了WSP文件.通过使用Power Shell,我将Wsp部署在了共享点中.现在,我尝试使用C#以编程方式部署另一个Wsp,但出现了错误提示访问被拒绝".
这是我的代码,用于添加和部署解决方案.
Hi,
I have developed solution also I created a WSP file. By using power shell i deployed the Wsp in the sharepoint. Now i trying to programatically deploy another Wsp using C# and I got an Erroe "Access Denied".
This is My Code to add and deploy the solution.
SPFarm.Local.Solutions.Add((Server.MapPath("~/_layouts") + "/DemoWSP10.wsp"));
SPSolution customSolution = SPFarm.Local.Solutions["DemoWSP10.wsp"];
customSolution.Deploy(DateTime.Now, false, true);
我调试了代码,发现异常发生在第一行.
谢谢,
Velkumar.
I debug the code,I find that the exception occured in the first line.
Thanks,
Velkumar.
推荐答案
SPSolution customSolution = SPFarm.Local.Solutions["DemoWSP10.wsp"];
您还应该使用 SPUtility.GetGenericSetupPath [ ^ ]而不是Server.MapPath
You should also be using SPUtility.GetGenericSetupPath[^] rather than Server.MapPath
这篇关于Sharepoint Wsp部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!