i have a simple .vcxproj File which looks like this:
...
<PropertyGroup>
<MyProjectName>sample_project</MyProjectName>
</PropertyGroup>
...
<ItemGroup>
<ClCompile Include="..\$(MyProjectName)\*.cpp" />
</ItemGroup>
...
Visual Studio 2012 is unable to load this project and states "...vcxproj : error : Object reference not set to an instance of an object.". Running MSBuild on the command line will build the project just fine as expected, i.e. it will compile all .cpp files in ..\sample_project.
These two variants will work in Visual Studio:
<ClCompile Include="..\sample_project\*.cpp" />
<ClCompile Include="..\$(MyProjectName)\main.cpp" />
Just the combination of a wildcard and a property fails.
Is this a bug in Visual Studio, and if is there a workaround for this? I found some stuff on SO regarding getting advanced wildcards to work in MSBuild, but nothing about that a simple construct such as this - which works in MSBuild without a problem - doesn't work in Visual Studio.
Thanks in advance.