当打开一个SPSite对象Filenotfound例外 - 64 [英] Filenotfound exception while opening an SPSite object - x64

查看:195
本文介绍了当打开一个SPSite对象Filenotfound例外 - 64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的asp.net应用程序打开一个网站,并显示相应网页的标题。但我发现FileNotFoundException异常,而试图打开该网站。同样的code完美的作品,当我运行在一个控制台应用程序。

我的天赋

在Windows Server 2008 R2 64位, SharePoint 2007的64位, Visual Studio 2005中

我的目标为asp.net应用程序设置为任何CPU。

据权限被认为是我检查,使用目前的身份下VS2005承载asp.net应用程序是有充分的权利。事实上,我也用于在IIS中的应用程序池相同的标识。

作为一个asp.net web应用程序

作为一个控制台应用程序

任何想法?

code

 使用(的SPSite网站=新的SPSite(HTTP:// DEV01 /))
{
    使用(的SPWeb网站= site.OpenWeb())
    {
         回复于(web.Title);
    }
}
 

解决方案

在开发SharePoint 2007的一个解决方案,VS 2010我得到这个问题。当我创建VS 2005相同的解决方案,我没有任何问题。我想一些DLL中的x86和x64之间的不匹配。想我会需要调整一下,以便VS 2010与SharePoint 2007的工作。

I've created a simple asp.net application to open a site and display the title of the corresponding web. But i'm getting FileNotFoundException while trying to open the site. The same code works perfectly when i run it in a console app.

My spec

Windows Server 2008 R2 x64, SharePoint 2007 x64, Visual Studio 2005

My target for the asp.net app is set to 'Any CPU'.

As far as permissions is considered i've checked that the current identity using under which VS2005 hosts the asp.net app is having full rights. In fact i've used the same identity for app pools in IIS.

As an asp.net web application

As a console application

Any ideas?

Code

using (SPSite site = new SPSite("http://dev01/"))
{
    using (SPWeb web = site.OpenWeb())
    {
         Response.Write(web.Title);
    }
}

解决方案

When developing a solution for SharePoint 2007 with VS 2010 i'm getting this problem. When i create the same solution with VS 2005 i dont have any issues. I guess some of the dlls are mismatching between x86 and x64. Guess i would need to tweak a bit to make VS 2010 working with SharePoint 2007.

这篇关于当打开一个SPSite对象Filenotfound例外 - 64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆