Visual Studio 2010:如何强制ASP.NET网站使用x86而不是&“任何CPU"?

编程入门 行业动态 更新时间:2024-10-28 08:21:14
本文介绍了Visual Studio 2010:如何强制ASP.NET网站使用x86而不是&“任何CPU"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

从非ASP.NET应用程序使用SharePoint DLL(仅x86)时,可以将平台目标"设置为x86(而不是任何CPU"),这样Visual Studio 2010和该应用程序都会加载SharePoint程序集很好.

When using SharePoint DLLs (which are x86 only) from a non-ASP.NET app, you can set the "Platform target" to x86 (instead of "Any CPU") so both Visual Studio 2010 and the app load the SharePoint assemblies fine.

但是,在x64开发系统上开发ASP.NET应用程序时,在构建网站时会收到以下可怕的错误消息:

However, when developing ASP.NET applications on an x64 development system, you get this dreaded error message when building the web-site:

无法加载文件或程序集"Microsoft.SharePoint.Search"或一个它的依赖关系.尝试是使程序加载格式不正确.

Could not load file or assembly 'Microsoft.SharePoint.Search' or one of its dependencies. An attempt was made to load a program with an incorrect format.

这是因为在Visual Studio 2010中进行构建时,默认情况下ASP.NET是任何CPU".

This is because ASP.NET by default is "Any CPU" when building in Visual Studio 2010.

我该如何更改?

我尝试了网站的属性页web.config,但无济于事.

I tried the property pages for the web-site, the web.config, but to no avail.

注意:这是针对开发系统的.我知道对于服务器系统,我可以通过在应用程序池默认值"中将启用32位应用程序"设置为真"来更改应用程序池以强制加载32位x86.

Note: this is for the development system. I know that for the server system, I can change the application pool to force loading of 32-bit x86 by setting "Enable 32-Bit Applications" to "True" in the "Application Pool Defaults".

推荐答案

您可以在< compilers>

compilerOptions="/platform:string"

可以在这里找到字符串: msdn.microsoft/en-us/library/zekwfyz4(VS.80).aspx

where string can be found here: msdn.microsoft/en-us/library/zekwfyz4(VS.80).aspx

更多推荐

Visual Studio 2010:如何强制ASP.NET网站使用x86而不是&amp;“任何CPU"?

本文发布于:2023-11-11 13:43:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1578610.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:而不是   网站   ASP   Studio   Visual

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!