首页 新闻 会员 周边

SPList

0
悬赏园豆:100 [待解决问题]
<h2><em>找不到位于 http://moss2010:85/ 的 Web 应用程序。请确认正确键入了此 URL。如果此 URL 需要提供现有内容,则系统管理员可能需要添加到指定应用程序的新请求 URL 映射。</em> </h2> <p><span style="font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;"><strong>说明: </strong>执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 <br /><br /><strong>异常详细信息: </strong>System.IO.FileNotFoundException: 找不到位于 http://moss2010:85/ 的 Web 应用程序。请确认正确键入了此 URL。如果此 URL 需要提供现有内容,则系统管理员可能需要添加到指定应用程序的新请求 URL 映射。<br /><br /><strong>源错误:</strong> <br /><br /></span></p> <table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td><code> <pre>行 14: protected void Page_Load(object sender, EventArgs e)行 15: {<span style="color: #ff0000;">行 16: SPSite site = new SPSite("http://moss2010:85/");//请把这个值换成你的SharePoint网站的URL</span>行 17: 行 18: SPWeb spweb = site.OpenWeb();</pre> </code></td> </tr> </tbody> </table> <p><span style="font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;"><br /><strong>源文件: </strong>C:\Users\lanmei\documents\visual studio 2010\Projects\AutoCode\AutoCode\Default.aspx.cs<strong> &nbsp;&nbsp; 行: </strong>16 <br /><br /><strong>堆栈跟踪:</strong> <br /><br /></span></p> <table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td><code> <pre>[FileNotFoundException: 找不到位于 http://moss2010:85/ 的 Web 应用程序。请确认正确键入了此 URL。如果此 URL 需要提供现有内容,则系统管理员可能需要添加到指定应用程序的新请求 URL 映射。] Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken) +17962697 Microsoft.SharePoint.SPSite..ctor(String requestUrl) +59 AutoCode._Default.Page_Load(Object sender, EventArgs e) in C:\Users\lanmei\documents\visual studio 2010\Projects\AutoCode\AutoCode\Default.aspx.cs:16 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint</pre> </code></td> </tr> </tbody> </table>
jone_chou的主页 jone_chou | 初学一级 | 园豆:0
提问于:2010-11-11 17:49
< >
分享
所有回答(4)
0

本机调试?不是只能是localhost或者ip的么?

顾晓北 | 园豆:10844 (专家六级) | 2010-11-11 17:51
是本机调试,用什么多是一样的.就是下面这个代码多是相同的错误. SPSite site = new SPSite("http://localhost:2008/");
支持(0) 反对(0) jone_chou | 园豆:0 (初学一级) | 2010-11-11 18:01
我真没看懂什么意思,看来还是我是菜鸟。。。SPSite site = new SPSite("http://localhost:2008/")这样的写法没见过。
支持(0) 反对(0) 顾晓北 | 园豆:10844 (专家六级) | 2010-11-11 18:04
0
SPWeb web;
web
= SPControl.GetContextWeb(Context);
SPSite site
= new SPSite(web.Url);
web
= site.OpenWeb();
SPList list
= web.Lists["SpecialList"];
paaple | 园豆:15 (初学一级) | 2010-11-15 12:21
0

我也是上面的错误,不知道要如何解决,望指教,谢谢。

cdelphi | 园豆:225 (菜鸟二级) | 2010-12-20 15:22
0

你建立的是普通的控制台应用吧。。你要建立一个sharepoint项目就不会报这错误了。

凉风ing | 园豆:332 (菜鸟二级) | 2012-03-14 17:37
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册