对于我的一些项目,我在Visual Studio 2013中收到此警告:
NuGet.targets" cannot be imported again. It was already imported
解决方案文件中的我的主WCF项目包含:
Project("{FAE04EC0-301F-11D3-BF4B-01C04F79EFBC}") = "WCF.Project", "Website\WCF.Project.csproj", "{AEFE3DD8-6E77-4449-9632-E2F0BADB6EBC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{778ACFB4-FB04-4E26-93DD-260E7B406E48}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
.nuget\NuGet.exe = .nuget\NuGet.exe
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
在我的WCF项目文件中,它具有:
<Import Project="$(SolutionDir).nuget\NuGet.targets" Condition="Exists('$(SolutionDir).nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir).nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir).nuget\NuGet.targets'))" />
</Target>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
现在我看一下......看起来有些原因是因为某种原因?
没关系,看起来这只是TFS中的一些奇怪的合并问题,是重复的线条。
对于可能有这个问题的其他人(比如我),也许这会有所帮助:
(卸载其他VS或清理道具文件夹)
VS Community - Nuget: targets and props warning about cannot be imported again