我在我的解决方案中添加了“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位”版本的System,而我需要“64位”版本。这可能吗?
答案 0 :(得分:0)
如果您将项目切换为/clr:safe
,则会定位到64& 32位机器。也,
请注意,对于每个新配置,您需要再次设置所有设置。