VS2012 CLR项目目标框架v3.5 [英] VS2012 CLR project target framwork v3.5

查看:183
本文介绍了VS2012 CLR项目目标框架v3.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试VS2012,以针对不同版本的.NET的方式对C ++/CLI的支持程度.

I was experimenting with VS2012 on how well it supports C++/CLI targetting the different versions of .NET.

似乎可以很好地为.NET v4.0和.NET v.4.5创建C ++/CLI项目.
因此,我希望它也支持.NET v3.5(VS2010无法使用其预期的工具集vc100做到这一点.)

It seems like it can perfectly well create C++/CLI projects for .NET v4.0 and .NET v.4.5. 
So i was hoping it would also support .NET v3.5 (VS2010 is unable to do this with its intended toolset vc100).

这是奇怪的事情开始的地方.乍一看,作为vcxproj文件的项目设置UI都很好地显示了TargetFrameworkVersion v3.5并引用了CLR 2.0程序集(system,system.data和system.xml).
但是,在编译项目时,它发现以某种方式不仅需要添加引用以添加对mscorlib 2.0.0.0的引用(当然是必需的),而且还必须添加对系统4.0.0.0和mscorlib 4.0.0.0的引用.这显然破坏了提供 选项可以针对.NET 4.0以下的任何内容,因为其他.NET项目需要至少针对4.0才能引用该库.
这是设计使然吗?

And this is where the strange things start. From first glance both the project settings UI as the vcxproj files nicely show TargetFrameworkVersion v3.5 and referencing CLR 2.0 assemblies (system, system.data and system.xml).
However, when compiling the project, it somehow found it necessary to not only add references to add a reference to mscorlib 2.0.0.0 (needed ofcourse), but also add references to system 4.0.0.0 and mscorlib 4.0.0.0. This obviously defeats the purpose of providing option to target anything below .NET 4.0, since other .NET projects need to target at least 4.0 to even reference the library.
Is this behavior by design?

其他人也遇到过同样的问题吗?如果是这样,如何解决(如果可能).

Has anyone else experienced the same problem? If so, how to solve this (if possible).

我正在使用VS2012 Premium Update 1.

I'm using VS2012 Premium Update 1.

推荐答案

发布应用程序,然后在3.5台计算机上安装.该发布将安装在3.5上运行所需的缺少的dll
Publish the application and then install on 3.5 machine.  The publish will install missing dll needed to run on 3.5


这篇关于VS2012 CLR项目目标框架v3.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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