ImportGroup Element


This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here

Contains a collection of Import elements that are grouped under an optional condition. For more information, see Import Element (MSBuild).



<ImportGroup Condition="'String A' == 'String B'">  
    <Import ... />  
    <Import ... />  

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.


Attribute Description
Condition Optional attribute.

The condition to be evaluated. For more information, see Conditions.

Child Elements

Element Description
Import Imports the contents of one project file into another project file.

Parent Elements

Element Description
Project Required root element of an MSBuild project file.



The following code example shows the ImportGroup element.

<Project xmlns="">  
        <Import Project="$(Targets1.targets) />  
        <Import Project="$(Targets2.targets) />  

See Also

Project File Schema Reference