VS 2010 setup projects depend on .NET after installing .NET 4.5

Article ID: 2735477 - View products that this article applies to.
Expand all | Collapse all

Symptoms

You have a Visual Studio 2010 project that creates an installer for a native VC++ application. The application does not require the .NET Framework to be installed. After installing .NET 4.5 (or Visual Studio 2012, which installs .NET 4.5), you observe that your VS 2010 Setup project now has a dependency on the .NET Framework.

Cause

A managed assembly is being incorrectly added to the list of references for the native project, causing the native project to have a dependency on the .NET Framework.

Resolution

The "AddAdditionalExplicitAssemblyReferences" property needs to be set to false for the VC++ project. One direct way to accomplish this would be to edit the .vcxproj file to do so. Before editing the .vcxproj, ensure that you do not have the project opened in any Visual Studio instances. With an XML or text editor (such as the one in Visual Studio), you will observe that the .vcxproj begins something like this:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <ItemGroup Label="ProjectConfigurations">

Before the "ItemGroup" tag, you will add a "PropertyGroup" that modifies that property, so the above will have had three lines inserted:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <PropertyGroup>
  <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
 </PropertyGroup>
 <ItemGroup Label="ProjectConfigurations">

Also, in the setup project, open the Launch Condition editor and remove the “Microsoft .NET” launch condition.

Once the changes have been made, you will need to rebuild the setup project.

More information

If you have multiple VC++ projects for which this change would be needed, you may wish to refer to this article: How to: Use the Same Target in Multiple Project Files
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2735477 - Last Review: November 16, 2012 - Revision: 2.0
Applies to
  • Microsoft Visual Studio 2010 Premium
  • Microsoft Visual Studio 2010 Professional
  • Microsoft Visual Studio 2010 Ultimate
  • Microsoft Visual Studio 2010 Service Pack 1
Keywords: 
kbtshoot KB2735477

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com