asp.net-mvc – 为什么我不能将asp.net mvc 4项目设置为x64

栏目: ASP.NET · 发布时间: 5年前

内容简介:翻译自:https://stackoverflow.com/questions/18892159/why-cant-i-set-asp-net-mvc-4-project-to-be-x64

我有一个VS2012解决方案,可简化如下:一个asp.net mvc 4 web应用程序,一个中间c#类库项目,以及一个用于计算的结束c#库项目等.

Web应用程序当前没有对其他项目的引用,并在构建时配置为“任何CPU”.最终项目是x64.我现在想通过中间项目将Web应用程序加入到最终项目中,但是当我尝试从Web应用程序引用中间x64项目时,我理解得到架构类型错误.如果我将Web应用程序设置为x64,我也会遇到相同类型的错误.

Web应用程序将在x64服务器上运行,因此我认为最简单的方法是将Web应用程序设置为x64,但我相信可能无法回溯更改它,即需要将其创建为x64.

我的问题是我可以将现有的网络应用程序转换为x64吗?如果没有,我如何创建一个x64 Web应用程序(我看不到任何选项)

编辑:即使我设置了一个新的mvc 4项目,将构建设置更改为x64我仍然遇到此问题.

听到我对软件开发很陌生,你会感到惊讶,虽然x86和x64之间的构建错误看起来很直观,但我并不理解为什么.在这个主题上似乎有很多帖子,答案是’将所有项目更改为任何Cpu,但我不得不将最终项目保持为x64.

我正在使用Windows 8和IIS 8.

作为参考,我在将中间项目的引用添加到Web应用程序时获得的构建警告是:

Warning 1 There was a mismatch between the processor architecture of the project being built “MSIL” and the processor architecture of the reference C:\MyPath\Sln\MiddleProject\bin\x64\Debug\MiddleProject.dll”, “AMD64”. This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

我花了很多时间来研究这个问题才找到答案.事实证明,您需要让IIS Express作为64位进程运行.你是怎样做的?

在VS中更改此内容:

工具|选项|项目和解决方案|网站项目|使用64位版本的IIS Express

我希望这有助于解决您的问题.

翻译自:https://stackoverflow.com/questions/18892159/why-cant-i-set-asp-net-mvc-4-project-to-be-x64


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Coming of Age in Second Life

Coming of Age in Second Life

Tom Boellstorff / Princeton University Press / 2008-04-21 / USD 29.95

The gap between the virtual and the physical, and its effect on the ideas of personhood and relationships, is the most interesting aspect of Boellstorff's analysis... Boellstorff's portrayal of a virt......一起来看看 《Coming of Age in Second Life》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

MD5 加密
MD5 加密

MD5 加密工具