将框架从4.0更改为4.5后运行我的.net项目时遇到问题

时间:2013-08-28 20:54:36

标签: .net .net-4.0

我打开了一个项目,并将其框架从4.5改为4.0(由于一些愚蠢的公司限制)。

There was a mismatch between the processor architecture of the project being built


"MSIL" and the processor architecture of the reference "My.DataAccessLayer.DimensionDB",
 "x86". 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.

这是一个警告。当我无论如何运行时,它会给我以下错误: -

The type or namespace name 'Membership' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?)

The type or namespace name 'Membership' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?)

我非常感谢任何帮助。

由于

1 个答案:

答案 0 :(得分:3)

基本上,您的应用程序定位于AnyCPU,但它引用了x86程序集。

您应该将目标更改为x86以解决这些警告(并允许其成功运行)。

请注意,在4.5中,这仍然会运行,因为默认值包括(新的4.5)“首选32位”选项,这会导致AnyCPU仍然使用x86。