Try Now
More in this section

Forums / Developing with Sitefinity / Bug: SitefinityWebApp.csproj contains multiple "Import Project" lines.

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

2 posts, 0 answered
  1. David
    David avatar
    11 posts
    02 Apr 2013
    17 Mar
    Link to this post

    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 ....."
  2. Brandon
    Brandon avatar
    0 posts
    28 Sep 2015
    13 Sep in reply to David
    Link to this post
    Thanks David, good catch.
2 posts, 0 answered