Building C++ CLR app for Platform Toolset v90 in VS2010 requires Visual Studio 2008 - c++

I've got a shiny new laptop with the latest Dev tools installed such as Visual Studio 2010.
Now I've got a task to build a C++ CLR app targeting the 2.0 runtime (this is well outside my comfort zone). So I've specifed the v90 Platform Toolset but when I build I get:-
error MSB8010: Specified platform toolset (v90) requires Visual Studio 2008. Please make sure that Visual Studio 2008 is installed on the machine.
Seriously, do I really need to install 2008 as well? Is there some way round this, such as just copying in some folders from a 2008 install?
If not just how much of the VS 2008 installation do I need?

Part of the problem is that VS2010 redid how compiling in c++ (cli or not) works. It now uses the MSBuild structure but I believe what you are trying to do will need the VCBuild framework that is not in 2010.
You may be able to get away with using the Visual Studio 2008 express to build. If not you should only need the c++ portion of VS2008.
Do you need to use the vc90 target though? I build my c++/cli (still new myself) with the vc10 target and it builds fine. (however i am targeting the 4.0 framework referencing some 2.0 portions)

If you set the 'Platform Toolset' in general tab of your project settings to "inherit from parent or project defaults" it will work in most of the cases.

in *.vcxproj
<PropertyGroup Label="Globals"> //Globals
<ProjectGuid>{E0047D4D-366D-4870-980B-DBB5A375BCE2}</ProjectGuid>
<RootNamespace>ECGConvertWrapper</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> //there
</PropertyGroup>

Related

ATL is not working when migrating to Visual Studio 2015

I have a project which uses an ATL component to create pie charts. It's working fine in Visual Studio 2010 but when I migrate it to Visual Studio 2015, its not working or not instantiated. It's crashing at runtime
I have installed VS 2015 with the C++ support on Windows 7.
I have set the platform toolset to v140.
I have installed the VS 2015 x86 redistributable package .
Target platform version 8.1.
Tried adding ATL support in existing MFC project by ATL wizard. This causes crash in ATL (_pModule == 0) and some Dlls also not registered due to this change so I had to revert the changes.
Why do you add ATL again support?
As far as I understand your question this is an existing project and has ATL support! The ASSERT simply tells you that you have two ATL modules.

Can't change Windows SDK version in Visual Studio C++ project

I have a Visual Studio C++ console application that I created with Visual Studio 2015 and now I can't compile it (with Visual Studio 2017) because it is targeting the Windows 8.1 SDK, which is not installed. The problem is that I can't retarget the project to the Windows 10 SDK.
What happens is that when I open the project properties page and go to General - Target Platform I see the Windows 10 SDK in the dropdown, and I am able to select it... but as soon as I press Apply, it reverts back to 8.1 by itself. No error message is provided.
Visual Studio installer says that, indeed, the listed SDK version is installed:
So what's going on here? Is there a way to retarget my project without having to install the Windows 8.1 SDK?
Not sure if that matters but: this project is actually just a "wrapper" around an existing bare project consisting of just a bunch of .cpp and .h files, which was developed by another person. I'm really not familiar with C++ development.
After hours of struggling with this problem, I coincidentally discovered that selecting Project Properties/General, changing "Platform Toolset" to v141_xp (instead of v141) forcibly drops the Windows SDK Version to 8.1 or 7.0. I'm not sure how Visual Studio chooses which SDK to use.
EDIT: You must edit .vcxproj and change both:
<TargetPlatformVersion>10.0.17134.0</TargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>

Visual Studio 2015: how to build ATL projects targeting Visual C++ v120

I am using Visual Studio 2015 Community Edition.
In VS2015 installer, selecting Common Tools and MFC Components under the Visual C++ node, I am able to build ATL based projects.
Selecting Tools and Windows SDKs, under Windows 8.1 and Windows Phone Tools node, I am able to build MFC projects based on Platform Toolset v120, that is Visual Studio 2013.
Now I would like to build an existing ATL project, relatively large, originally built in Visual Studio 2013.
When I set Platform Toolset = 'v120' in the ATL project, the compiler is unable to find the ATL headers.
Is it possible to install them?
Do I have to install both VS2013 and VS2015?
You do need to install the earlier version of Visual Studio if you want to use its compiler toolchain. You can also open a developer command prompt to select the compiler version and use msbuild to build the target using that specific compiler but you still need to have installed the compiler version you need.

How to install Visual Studio Build Tools 2010 on Visual Studio 2015 Community?

I have a project created on Visual Studio 2010. When I try to run the project on Visual Studio 2015 Community edition I get the error below,
Severity Code Description Project File Line
Error MSB8020 The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". graphics C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets 55
And when I tried to build it with Visual Studio 2015 Build Tools I encountered about 1500+ errors.
Is there any way to make the project work?
If you can't install VS2010, Windows SDK for Windows 7 contains needed compiler tools (v100), you may actually skip installing the SDK itself and install only the compiler tools, headers and libs. Please note, that the compiler included in Windows SDK is the same that VS2010 has, but VS2010 SP1 has a bit newer compiler. If you need that, you'll also need to install Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1. But be aware, that if you install these, you may have issues later if you decide to install VS2010, there are bugs in installer that requires you to install components in strict order. Also, if your code uses MFC or ATL you must install VS2010, installing Windows SDK will not be enough.
You either install VS 2010 and build your project, or better yet you upgrade your projects. The VS 2015 custom install options will let you install the v120 Platform Toolset, but not the v110 or v100 Platform Toolsets.
One major change in VS 2015 is that the C++ tools (i.e. v140) are not installed by the Typical installation option. See the Visual C++ Team Blog.
Keep in mind that Visual C++ 2010 used the C++0x Draft Standard, and Visual C++ 2015 meets the C++11 Standard with the exception of Expression SFINAE (which is partly there in Update 1), so quite a bit has changed in the intervening years including some breaking changes. Since you are jumping three major releases at once--and about 10 minor updates--, it can be a bit overwhelming especially working through all the new warnings.
Another thing to keep in mind is that Visual C++ 2010 used the Windows 7.1 SDK, while Visual C++ 2012 or later use the Windows 8.x SDK. There's been a lot of change there too particularly for DirectX development. It's particularly important for Windows desktop apps that you set the _WIN32_WINNT preprocessor define for your target platform as the Windows 8.x SDK does not default to the 'oldest supported platform' like earlier Windows SDKs did. See Using the Windows Headers
VS 2010 and the v100 toolset supports targeting Windows XP and Windows Server 2003. The v140 toolset does not support targeting Windows XP / Server 2003. You have to use v140_xp Platform Toolset instead. See this post for some notes as this means you are again using the Windows 7.1 SDK rather than the Windows 8.x SDK with the _xp toolsets.
See Breaking Changes in Visual C++ 2012, Breaking Changes in Visual C++ 2013, and Breaking Changes in Visual C++ 2015.
See also Support For C++11/14/17 Features (Modern C++), and Where is the DirectX SDK?.
If you need to build the code both with VS 2010 and with VS 2015, then you should create two projects/solution files, one for each. You may also want to read this article for some notes on writing code that can build with multiple Visual C++ toolsets, which again is particularly challenging due to the Windows SDK changes.
VS 2015 supports targeting Windows Vista SP2, Windows 7 SP1, Windows 8.0, Windows 8.1, Windows 10, and optionally Windows XP SP3. It does not support targeting Windows Vista RTM, Windows Vista SP1, or Windows 7 RTM.

manifest is picking predifined redist

i am developing a software using Visual C++ 2008 Express Edition. after build in release mode, i have made a setup file with latest redist 2008. the software is running in my PC fine. in my PC this redist are installed :
in my friends PC, the same redist are installed. but the software is crashing on my friends PC.
from the event log it shows:
as you can see, it is demanding 9.0.21022.8 version of redist whether there is previously installed latest version of redist(9.0.30729.17). so, i go for a google. from the internet, i edit my C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtassem.h
but it didn't help. then i check my project manifest. and i saw :
but i don't know how to edit manifest (i am new in VC++). and i also check C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest. i shows:
i have tried to find out 9.0.21022.8 version of redist in the internet. but i have failed. from my VCExpress installer there is a file named vcredistmin_x86.exe :
as you can see the version of the file is 9.0.21022.8. i think this is the redist i need. but i cannot install it. it says "run the setup.exe file"
what can i do?
Edit(if i am asking two different answer from this question, please inform me. i will delete this edited part):
i am now wanting to deploy my project from Microsoft Visual studio 2008. i have uninstalled previous Microsoft Visual C++ 2008 express edition. but when i am trying to install Microsoft Visual studio 2008, it says
Installation Requirements:
A compatible version of Visual Studio 2008 was not detected on the
system. This update is designed for only the Microsoft Visual Studio
2008 (ENU) product family, and is not compatible with any Express
editions.
guys, have you any idea what to do?
From what I see this download is 9.0.21022.8: http://www.microsoft.com/en-us/download/details.aspx?id=29
I don't know about VS Express, in VS full version there are the vcredist_x86/x64/arm.exe available in the install directory (For VS2012: .../Microsoft Visual Studio 11.0\VC\redist\1033)
If it's acceptable for you, the simplest way to forget about this problems you can statically link with Runtime by changing your project properties: C/C++ -> Code Generation -> Runtime Library, select /MT or /MTd. Runtime library will be included into your executable so you won't have to install it on client machine.