1

我已将“Visual C++ CLR”项目添加到我的解决方案中。一切都建立起来没有错误。然后在“配置管理器”中,我将“Win32”配置更改为“x64”,因为我需要为 x64 编译。现在我的项目无法构建。我有很多错误,我不知道如何解决

Error   1   error C2871: 'System' : a namespace with this name does not exist   C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   3   1   ACliAdapter
Error   2   error C2653: 'System' : is not a class or namespace name    C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   4   1   ACliAdapter
Error   3   error C2871: 'Reflection' : a namespace with this name does not exist   C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   4   1   ACliAdapter
Error   4   error C2653: 'System' : is not a class or namespace name    C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   5   1   ACliAdapter
Error   5   error C2871: 'CompilerServices' : a namespace with this name does not exist C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   5   1   ACliAdapter
Error   6   error C2653: 'System' : is not a class or namespace name    C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   6   1   ACliAdapter
Error   7   error C2871: 'InteropServices' : a namespace with this name does not exist  C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   6   1   ACliAdapter
Error   8   error C2653: 'System' : is not a class or namespace name    C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   7   1   ACliAdapter
Error   9   error C2871: 'Permissions' : a namespace with this name does not exist  C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   7   1   ACliAdapter
Error   10  error C2337: 'AssemblyTitleAttribute' : attribute not found C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   14  1   ACliAdapter
Error   11  error C2337: 'AssemblyDescriptionAttribute' : attribute not found   C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   15  1   ACliAdapter
Error   12  error C2337: 'AssemblyConfigurationAttribute' : attribute not found C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   16  1   ACliAdapter
Error   13  error C2337: 'AssemblyCompanyAttribute' : attribute not found   C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   17  1   ACliAdapter
Error   14  error C2337: 'AssemblyProductAttribute' : attribute not found   C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   18  1   ACliAdapter
Error   15  error C2337: 'AssemblyCopyrightAttribute' : attribute not found C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   19  1   ACliAdapter
Error   16  error C2337: 'AssemblyTrademarkAttribute' : attribute not found C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   20  1   ACliAdapter
Error   17  error C2337: 'AssemblyCultureAttribute' : attribute not found   C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   21  1   ACliAdapter
Error   18  error C2337: 'AssemblyVersionAttribute' : attribute not found   C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   34  1   ACliAdapter
Error   19  error C2337: 'ComVisible' : attribute not found C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   36  1   ACliAdapter
Error   20  error C2337: 'CLSCompliantAttribute' : attribute not found  C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   38  1   ACliAdapter
Error   21  error C2337: 'SecurityPermission' : attribute not found C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   40  1   ACliAdapter
Error   22  error C2653: 'SecurityAction' : is not a class or namespace name    C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   40  1   ACliAdapter
Error   23  error C2065: 'RequestMinimum' : undeclared identifier   C:\Oleg\projects\Va.MBClient\ACliAdapter\AssemblyInfo.cpp   40  1   ACliAdapter
Error   24  error C2871: 'System' : a namespace with this name does not exist   c:\oleg\projects\Va.mbclient\Acliadapter\ACliAdapter.h  5   1   ACliAdapter
Error   25  error C2059: syntax error : 'public'    c:\oleg\projects\Va.mbclient\Acliadapter\ACliAdapter.h  9   1   ACliAdapter
Error   26  error C2143: syntax error : missing ';' before '{'  c:\oleg\projects\Va.mbclient\Acliadapter\ACliAdapter.h  10  1   ACliAdapter
Error   27  error C2447: '{' : missing function header (old-style formal list?) c:\oleg\projects\Va.mbclient\Acliadapter\ACliAdapter.h  10  1   ACliAdapter
Error   34  The type or namespace name 'ACliAdapter' could not be found (are you missing a using directive or an assembly reference?)   C:\Oleg\projects\Va.MBClient\Va.MBClient\Program.cs 14  7   Va.MBClient
Error   35  The type or namespace name 'ACliAdapterMain' could not be found (are you missing a using directive or an assembly reference?)   C:\Oleg\projects\Va.MBClient\Va.MBClient\Program.cs 28  24  Va.MBClient
Error   36  Metadata file 'C:\Oleg\projects\Va.MBClient\Va.MBClient\bin\x64\Debug_TestGate\Va.MBClient.exe' could not be found  C:\Oleg\projects\Va.MBClient\TerminatorConsole2\CSC TerminatorConsole2

为什么 x64 配置在 c++-cli 项目中不起作用?

upd我知道认为可能的项目引用系统的“32 位”版本,而我需要“64 位”版本。这可能吗?

4

1 回答 1

0

如果您将项目切换到/clr:safe它将同时针对 64 位和 32 位机器。此外,请考虑对于每个新配置,您需要再次设置所有设置。

于 2012-11-24T16:08:13.267 回答