打开 SPSite 对象时 Filenotfound 异常 - x64 [英] Filenotfound exception while opening an SPSite object - x64

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

问题描述

我创建了一个简单的 asp.net 应用程序来打开一个站点并显示相应网站的标题.但是我在尝试打开网站时收到 FileNotFoundException.当我在控制台应用程序中运行相同的代码时,它可以完美运行.

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.

我的规格

Windows Server 2008 R2 x64,SharePoint 2007 x64,视觉工作室 2005

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

我的 asp.net 应用目标设置为任何 CPU".

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

就权限而言,我已经检查过使用 VS2005 托管 asp.net 应用程序的当前身份是否具有完全权限.事实上,我在 IIS 中对应用程序池使用了相同的标识.

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.

作为一个 asp.net 网络应用程序

作为控制台应用程序

有什么想法吗?

代码

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

推荐答案

在使用 VS 2010 为 SharePoint 2007 开发解决方案时,我遇到了这个问题.当我使用 VS 2005 创建相同的解决方案时,我没有任何问题.我猜一些 dll 在 x86 和 x64 之间不匹配.我想我需要稍微调整一下才能让 VS 2010 与 SharePoint 2007 一起使用.

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 异常 - x64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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