Hi readers,

I recently moved one project to a new location in TFS and started getting the following build error:

“D:\[PATH]\File.wxs (96): The ComponentGroup element contains an unexpected attribute ‘Directory’.”

Just to provide you with some context, this solution has several projects of different types including web services, web sites, C# library projects,  data base projects and one Wix installer. That error is weird since the same definition was working in the previous location. The line indicated in the error (96) from the Wix project is described below:

<ComponentGroup Id=”ProductComponents” Directory=”INSTALLFOLDER”>

I fixed the error by moving the problematic tag/attribute Directory=”INSTALLFOLDER” from parent ComponentGroup to all Component children elements as shown below:

<ComponentGroup Id=”ProductComponents”>

      <Component Directory=”INSTALLFOLDER”>

After that I received a new error indicating that another file was missing (a .ico file specifically). I fixed that error by checking file properties and changing the following setting:

Copy to Output Directory: Copy always

Again, it’s weird because the build definition was working all right in the original location but for some reason some settings were lost. Luckily I managed to solved it. I hope this saves you some sometime if you find the same issue.

Cheers,

Javier Andrés Cáceres Alvis

Microsoft Most Valuable Professional – MVP

Intel Black Belt Software Developer