Bug: SitefinityWebApp.csproj contains multiple "Import Project" lines. - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Bug: SitefinityWebApp.csproj contains multiple "Import Project" lines.

  • Bug: SitefinityWebApp.csproj contains multiple "Import Project" lines.
  • When building a project in Visual Studio 2015 I get the following warning message :

    Warning     "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.props" cannot be imported again. It was already imported at "E:\!Sitefinity\Projects\SubZero\SitefinityWebApp.csproj (3,3)". This is most likely a build authoring error. This subsequent import will be ignored.

    When I open the build file for the project "SitefinityWebApp.csproj" I notice it contains the following line  multiple times  
    <Import Project = "$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition = "Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />"

    Is this a known bug? 
    I've not determined the exact cause yet, but it happens even if the file has never been opened in Visual Studio. 

    The solution:

    1.  Ensure the project is not open in Visual Studio. 
    2. Open the file "SitefinityWebApp.csproj" in an editor (ie: notepad)
    3. Delete 2nd & any subsequent occurrences of the line mentioned above "Import Project ="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props ....."
  • Thanks David, good catch.