Bug: SitefinityWebApp.csproj contains multiple "Import

Posted by Community Admin on 04-Aug-2018 06:14

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

All Replies

Posted by Community Admin on 17-Mar-2016 00:00

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 ....."

Posted by Community Admin on 13-Sep-2016 00:00

Thanks David, good catch.

This thread is closed