Friday, March 11, 2011

MSBuild Fail Error: The type 'Silverlight.Web.User' already contains a definition for 'DisplayName'

MSBuild Fail Error: The type 'Silverlight.Web.User' already contains a definition for 'DisplayName'
I got this error when I was trying to make automated build for Silverlight 4.0 application
using TFS 2010.
The complete error was "Generated_Code\Models\Shared\User.shared.cs (13): The type 'MSIT.ES.SDPvNext.SilverlightUX.Web.User' already contains a definition for 'DisplayName'"
I resolved this issues by changing Platform and Configuration combination on the
TfsBuild.proj file previously it was "Release|x86" and on the Build Definition window,
change the MSBuild Platform from Auto to x86.

TfsBuild.proj

<ItemGroup>
    <ConfigurationToBuild Include="Release|AnyCPU">
      <FlavorToBuild>Release</FlavorToBuild>
      <PlatformToBuild>AnyCPU</PlatformToBuild>
    </ConfigurationToBuild>
</ItemGroup>

Build Definition Window

No comments: