Warning MSB4011: "Microsoft.CSharp.targets" cannot be imported again.
See original GitHub issueSteps to reproduce
dotnet build
Expected behavior
No build warnings
Actual behavior
C:\Program Files\dotnet\sdk\2.0.3\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.targets(41,3): warning MSB4011: “C:\Program Files\dotnet\sdk\2.0.3\Microsoft.CSharp.targets” cannot be imported again. It was already imported at “C:\Projects\SomeProject.csproj (106,3)”. This is most likely a build authoring error. This subsequent import will be ignored.
Environment data
dotnet --info
output:
.NET Command Line Tools (2.0.3)
Product Information: Version: 2.0.3 Commit SHA-1 hash: 12f0c7efcc
Runtime Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64 Base Path: C:\Program Files\dotnet\sdk\2.0.3\
Microsoft .NET Core Shared Framework Host
Version : 2.0.3 Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df
Issue Analytics
- State:
- Created 6 years ago
- Comments:30 (14 by maintainers)
Top GitHub Comments
This is what a regular console app csproj file looks like:
With this, I don’t see the error you are mentioning above.
I run into this issue as well with my PR builds.
https://ci.dot.net/job/dotnet_roslyn/job/features_quick-info-party/job/windows_debug_unit32_prtest/70/
https://ci.dot.net/job/dotnet_roslyn/job/features_quick-info-party/job/windows_debug_unit64_prtest/64/console