为什么我的Visual Studio Win32项目需要安装.NET 3.5 SP1? [英] Why does my Visual Studio Win32 project require .NET 3.5 SP1 to install?

查看:343
本文介绍了为什么我的Visual Studio Win32项目需要安装.NET 3.5 SP1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio 2008,我创建了一个C ++ Win32 项目。要发布该程序,我在同一个解决方案中创建了一个Visual Studio安装项目。

Using Visual Studio 2008, I created a C++ Win32 project. To release the program, I made a Visual Studio setup project within the same solution.

setup.exe提示我的用户安装.NET 3.5 SP1,这通常是15分钟安装,并且只允许管理员级帐户。如果他们不存在一个错误,沿着错误的框架的线。我困惑的是什么在我的项目需要.NET 3.5 SP1。我怀疑只是因为这是我的PC上的框架...有一种方法来扩大其框架将运行吗?

The setup.exe prompts my users to install .NET 3.5 SP1, which is often a 15+ minute install and only allowed to administrator level accounts. If they do not there is an error along the lines of "wrong framework". I am confused over what in my project requires .NET 3.5 SP1. I suspect just because that is the framework my PC is on... Is there a way to broaden which frameworks it will run on?

代码大多是Win32 API调用。在这种情况下,这里是我的依赖和#includes:

The code is mostly Win32 API calls. Just in case, here are my dependencies and #includes:

gdiplus.lib
comctl32.lib
Winmm.lib
d3d9.lib

(安装项目自动添加comdlg32.dll,然后请告诉我排除它。)

(The setup project automatically added comdlg32.dll, then tells me to exclude it.)

#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string.h>

#include <commctrl.h>
#include <process.h>
#include <sstream>
#include <math.h>
#include <d3d9.h>
#include <time.h>
#include <gdiplus.h>

我的猜测是,通过windows.h的某处有一个WIN_VER或类似的版本设置, .NET 3.5 SP1,这是依赖关系的来源。如果是这样,我需要定义一个不同的版本,我很想听到大家的意见是/不,和如何,以及我多远回到最大包容。

My guess is that somewhere through windows.h there is a WIN_VER or similar version setting that is set to .NET 3.5 SP1, and this is where the dependency comes from. If that is the case, and I need to define a different version, I would love to hear everyone's advice on does / don'ts / and how-to and how far back can I go for maximum inclusion.

推荐答案

在VS 2008中,默认目标框架是.NET 3.5。

In VS 2008 the default target framework is .NET 3.5.

公共属性页面有一个定向框架下拉列表,但在测试项目中,我创建的是灰色的,所以看起来这个项目创建后不能更改。

For C++ on the Common Properties page there's a "Targeted Framework" drop down, but on the test project I created it's greyed out, so it looks like this can't be changed after the project has been created.

我创建了第二个C ++项目,并从新建项目对话框中选择了2.0模板,并在目标框架中有2.0。

I created a second C++ project and selected the 2.0 Template from the New Project dialog and that had 2.0 in the "Targeted Framework".

想要定位一个较低版本的框架,它看起来像你必须正确地创建你的项目在第一位。

So if you want to target a lower version of the framework it looks like you've got to create your project correctly in the first place.

编辑:关于哪个版本的框架你应该定位 - 这一切都取决于(!)

As to which version of the framework you should target - it all depends(!)

你需要使用3.0或3.5的任何功能吗?如果不是那么去2.0。如果你这样做然后选择一个,并采取下载的命中。我不能说,任何类的用户有可能会有一个特定的版本安装。随着时间的推移,他们将有更多的可能会安装3.5其他应用程序将需要它。

Do you need to use any of the 3.0 or 3.5 features? If not then go for 2.0. If you do then select that one and take the hit of the download. I can't say how likely it is that any class of user will have a particular version installed. As time goes on it will be increasingly likely that they will have 3.5 installed as other apps will require it.

这篇关于为什么我的Visual Studio Win32项目需要安装.NET 3.5 SP1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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