Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/150.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 编译C++/VisualStudio2010中的CLR.NETFramework 3.5仍然依赖于4.0_C#_C++_Visual Studio 2010_.net 3.5_Clr - Fatal编程技术网

C# 编译C++/VisualStudio2010中的CLR.NETFramework 3.5仍然依赖于4.0

C# 编译C++/VisualStudio2010中的CLR.NETFramework 3.5仍然依赖于4.0,c#,c++,visual-studio-2010,.net-3.5,clr,C#,C++,Visual Studio 2010,.net 3.5,Clr,我正处于将CPP DLL与C结合使用的最后一个阶段,但这种依赖性使我们无法将其用作.NET 3.5: c:\program files (x86)\reference assemblies\microsoft\framework\v3.5\system.core.dll : warning C4945: 'Action' : cannot import symbol from 'c:\program files (x86)\reference assemblies\microsoft\frame

我正处于将CPP DLL与C结合使用的最后一个阶段,但这种依赖性使我们无法将其用作.NET 3.5:

c:\program files (x86)\reference assemblies\microsoft\framework\v3.5\system.core.dll : warning C4945: 'Action' : cannot import symbol from 'c:\program files (x86)\reference assemblies\microsoft\framework\v3.5\system.core.dll': as 'System::Action' has already been imported from another assembly 'mscorlib'
c:\windows\microsoft.net\framework\v4.0.30319\mscorlib.dll : see declaration of 'System::Action'
first seen type is used; re-order imported assemblies to use the current type   

我们使用Visual Studio 2010,PlatformToolSet设置为v100(v90需要安装2008),TargetFrameWork设置为.NET 3.5

如何使用c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll和/或c:\program files(x86)\reference Assembly\microsoft\framework\v3.5\system.core.dll强制编译它

有没有办法实现这个目标?
提前感谢…

这是不可避免的,在构建程序时,您链接的库中有托管代码。它实现了一个模块初始值设定项,确保在运行任何非托管代码之前正确初始化CRT。对于VS2010及更高版本,库代码使用.NET4类型。因此,试图以任何旧版本的.NET为目标是没有意义的。如果3.5是一个硬性要求(从来都不是),那么您必须使用VS2008进行构建。感谢@Hans-我们现在正在切换到VS2008,面临新的错误集。。。现在就处理。
Error   C1197   cannot reference 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll' as the program has already referenced 
'c:\windows\microsoft.net\framework\v4.0.30319\mscorlib.dll'    
PROJECTNAME L:\PROJECTNAME/MYFILE.cpp       
    PROJECTNAME c:\program files (x86)\reference assemblies\microsoft\framework\v3.5\system.core.dll