为什么我不能设置asp.net MVC 4项目是64 [英] Why can't I set asp.net mvc 4 project to be x64

查看:127
本文介绍了为什么我不能设置asp.net MVC 4项目是64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以如下简化一个VS2012的解决方案:一个asp.net MVC 4 Web应用程序,中间的C#类库项目,并为计算终止的C#库项目等。

Web应用程序目前拥有的其他项目的引用和建设时被配置为任何CPU。最终的项目是64。我现在想通过中间的项目加入Web应用程序到最终项目,而是试图从Web应用程序中引用中间64项目时,我可以理解GET体系结构类型的错误。如果我设置Web应用程序到x64我也得到相同类型的错误。

Web应用程序将运行在和x64服务器,所以我认为这样做最简单的事情是设置Web应用程序到x64,但我相信,即它需要创建,因为它可能的情况下,你不能追溯改变64。

我的问题是的我可以转换现有的web应用程序到x64?如果不是,我怎么创建一个64位的网络应用程序(我没有看到任何选项)
编辑:即使当我成立了一个新的MVC 4项目,改变构建设置到x64我仍然得到这个问题

您会惊讶地听到,我是很新的软件开发,虽然建立x86和x64之间的误差似乎直觉我真的不明白为什么。有似乎对这个话题的答案是改变所有的项目,任何CPU很多帖子,但我不得不保持月底项目为64。

我使用的是Windows 8和IIS 8。

有关参考,生成警告增加了对中间项目的Web应用程序的参考,当我得到的是:


  

警告1有该项目正在建设MSIL的处理器架构和参考C的处理器架构之间的不匹配:\\ mypath中\\ SLN \\ MiddleProject \\ BIN \\ 64 \\调试\\ MiddleProject.dll,AMD64 这种不匹配可能会导致运行时故障。请考虑通过配置管理器更改项目的目标处理器架构,以便使其处理器架构项目和引用之间,或采取与相匹配的有针对性的处理器架构引用的依赖项目的处理器架构。



解决方案

我花了很多挖这个同样的问题找到答案的。事实证明,你需要得到IIS防爆preSS作为一个64位进程中运行。你是怎么做到的?

在VS更改此:
工具|选项​​|项目和解决方案| Web项目|使用IIS防爆preSS的64位版本

我希望帮助您解决问题。

I have a VS2012 solution that can be simplified as follows: An asp.net mvc 4 web app, a middle c# class library project, and an end c# library project for calculations etc.

The web app currently has no references to the other projects and is configured to 'Any CPU' when building. The end project is x64. I now want to join the web app to the end project via the middle project, but I understandable get architecture type errors when trying to reference the middle x64 project from the web app. If I set the web app to x64 I also get the same type of error.

The web app will run on and x64 server and so I think the easiest thing to do would be to set the web app to x64 but I believe it might be case that you cannot retrospectively change it i.e. it needs to be created as x64.

My question is Can I convert the existing web app to x64? If not, how do I create a x64 web app (I could not see any option) EDIT: Even when I set up a new mvc 4 project, change the build setting to x64 I still get this problem.

You'll be surprised to hear that I am very new to software development, and although build errors between x86 and x64 seem intuitive I don't really understand why. There are many posts it seems on this topic with answers being 'change all projects to Any Cpu, but I am constrained to keeping the end project as x64.

I'm using Windows 8 and IIS 8.

For reference, the build warning I get when adding a reference for the middle project to the web app is:

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.

解决方案

It took me a lot of digging on this same problem to find the answer. It turns out you need to get IIS Express to run as a 64 bit process. How do you do that?

Change this in VS: Tools | Options | Projects and Solutions | Web Projects | Use the 64 bit version of IIS Express

I hope that helps resolve your issue.

这篇关于为什么我不能设置asp.net MVC 4项目是64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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