Since I have many configurations for one project, I wanted to clean up .csproj a bit.
I moved all the config definitions to separate files using the Conditional ItemGroup and imported them into .csproj with:
<Import Project="conf/file.targets">
Everything seems fine, except for one, in explorer explorer I do not see the files that are defined in .targets, but the project compiles without any problems. Is this a mistake or normal behavior? How can I view files imported from .targets? (for example, SomeFile and SomeFile2.)
Example test.targets:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'TestConfig|x86'">
<OutputPath>bin\TestConfig\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup Condition=" '$(Configuration)'=='TestConfig' ">
<Compile Include="SomeFile.cs" />
<Compile Include="SomeFile2.cs" />
</ItemGroup>
</Project>
Everything was visible in Solution Explroer when it was defined in .csproj.
PS. I searched on google and stackoverflow, but did not find useful information.