|
1 | 1 | # netcore2.1-centos7-build-issue
|
2 |
| -Captures a very simple reproduction for debugging. The issue appears where a newly created netcoreapp2.1 targeted project cannot build blaming missing assemblies (including System). |
| 2 | + |
| 3 | +Captures a very simple reproduction for debugging. The issue appears where a newly created netcoreapp2.1 targeted project cannot build blaming missing assemblies (including System). Following these equivalent steps on a Windows 10 machine with .NET Core SDK 2.1 installed works flawlessly. |
| 4 | + |
| 5 | +## Steps to reproduce |
| 6 | + |
| 7 | +- clone this repo |
| 8 | +- check out the branch named *master* (you are likely already here) or named *start-here* (in case master has moved) |
| 9 | +- run the *create.sh* script |
| 10 | +```bash |
| 11 | +dotnet new console --name should-build --framework netcoreapp2.1 |
| 12 | +cp clean.sh ./should-build |
| 13 | +cp fail-to-build.sh ./should-build |
| 14 | +``` |
| 15 | +- cd into the should-build folder |
| 16 | +- run the *clean.sh* script |
| 17 | +```bash |
| 18 | +rm -rf obj |
| 19 | +rm -rf bin |
| 20 | +``` |
| 21 | +- run the *fail-to-build.sh* script |
| 22 | +```bash |
| 23 | +dotnet restore |
| 24 | +dotnet build |
| 25 | +``` |
| 26 | +- observe the issue |
| 27 | + |
| 28 | +Expected result : successful restore, successful build |
| 29 | + |
| 30 | +Observed result : successful restore, failed build |
| 31 | + |
| 32 | +```bash |
| 33 | +> pwd |
| 34 | +/home/jkeller/netcore2.1-centos7-build-issue/should-build |
| 35 | +pwd |
| 36 | +> ./clean.sh |
| 37 | +> ./fail-to-build.sh |
| 38 | + Restoring packages for /home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj... |
| 39 | + Generating MSBuild file /home/jkeller/netcore2.1-centos7-build-issue/should-build/obj/should-build.csproj.nuget.g.props. |
| 40 | + Generating MSBuild file /home/jkeller/netcore2.1-centos7-build-issue/should-build/obj/should-build.csproj.nuget.g.targets. |
| 41 | + Restore completed in 259.17 ms for /home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj. |
| 42 | +Microsoft (R) Build Engine version 15.7.145.53551 for .NET Core |
| 43 | +Copyright (C) Microsoft Corporation. All rights reserved. |
| 44 | + |
| 45 | + Restore completed in 47.99 ms for /home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj. |
| 46 | + You are working with a preview version of the .NET Core SDK. You can define the SDK version via a global.json file in the current project. More at https://go.microsoft.com/fwlink/?linkid=869452 |
| 47 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(4,20): error CS0400: The type or namespace name 'System' could not be found in the global namespace (are you missing an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 48 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(10,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 49 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(11,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 50 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(12,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 51 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(13,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 52 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(14,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 53 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(15,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 54 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(16,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 55 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(4,71): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 56 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(4,99): error CS0246: The type or namespace name 'FrameworkDisplayName' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 57 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(4,122): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 58 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(10,55): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 59 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(11,61): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 60 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(12,59): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 61 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(13,68): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 62 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(14,55): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 63 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(15,53): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 64 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(16,55): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 65 | +Program.cs(1,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 66 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(2,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 67 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(3,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 68 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(7,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 69 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(8,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 70 | +Program.cs(5,11): error CS0518: Predefined type 'System.Object' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 71 | +Program.cs(7,26): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 72 | +Program.cs(7,16): error CS0518: Predefined type 'System.Void' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 73 | + |
| 74 | +Build FAILED. |
| 75 | + |
| 76 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(4,20): error CS0400: The type or namespace name 'System' could not be found in the global namespace (are you missing an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 77 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(10,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 78 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(11,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 79 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(12,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 80 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(13,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 81 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(14,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 82 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(15,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 83 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(16,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 84 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(4,71): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 85 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(4,99): error CS0246: The type or namespace name 'FrameworkDisplayName' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 86 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(4,122): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 87 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(10,55): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 88 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(11,61): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 89 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(12,59): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 90 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(13,68): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 91 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(14,55): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 92 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(15,53): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 93 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(16,55): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 94 | +Program.cs(1,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 95 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(2,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 96 | +/tmp/.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(3,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 97 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(7,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 98 | +obj/Debug/netcoreapp2.1/should-build.AssemblyInfo.cs(8,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 99 | +Program.cs(5,11): error CS0518: Predefined type 'System.Object' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 100 | +Program.cs(7,26): error CS0518: Predefined type 'System.String' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 101 | +Program.cs(7,16): error CS0518: Predefined type 'System.Void' is not defined or imported [/home/jkeller/netcore2.1-centos7-build-issue/should-build/should-build.csproj] |
| 102 | + 0 Warning(s) |
| 103 | + 26 Error(s) |
| 104 | + |
| 105 | +Time Elapsed 00:00:01.74 |
| 106 | +``` |
| 107 | + |
| 108 | +I visited the link at [https://go.microsoft.com/fwlink/?linkid=869452](https://docs.microsoft.com/en-us/dotnet/core/tools/global-json) which indicated that *global.json* could be used to specify the tooling version used but that did not produce any changes in behavior. |
| 109 | + |
| 110 | +This activity succeeds perfectly (using CMD equivalent steps) on a Windows 10 machine. |
| 111 | + |
| 112 | +The issue seems like it may be related to the GitHub issues noted in the Configuration section below. |
| 113 | + |
| 114 | +## Configuration |
| 115 | + |
| 116 | +The filesystem seems to be XFS which is called out in GitHub issue [Directory.EnumerateDirectories doesn't return directory list on rhel7.2 #29095](https://github.com/dotnet/corefx/issues/29095) as contributing to issue [dotnet restore does not populate targets in project.assets.json on RHEL7.2 #8819](https://github.com/dotnet/cli/issues/8819). The *ftype=0* |
| 117 | + |
| 118 | +```bash |
| 119 | +> df |
| 120 | +Filesystem Type Size Used Avail Use% Mounted on |
| 121 | +/dev/mapper/vg_sys-lv_root xfs 125G 63G 63G 50% / |
| 122 | +/dev/mapper/vg_sys-lv_home xfs 437G 356G 81G 82% /home |
| 123 | +``` |
| 124 | + |
| 125 | +```bash |
| 126 | +> xfs_info /home |
| 127 | +meta-data=/dev/mapper/vg_sys-lv_home isize=256 agcount=6, agsize=22073856 blks |
| 128 | + = sectsz=4096 attr=2, projid32bit=1 |
| 129 | + = crc=0 finobt=0 spinodes=0 |
| 130 | +data = bsize=4096 blocks=114509824, imaxpct=25 |
| 131 | + = sunit=0 swidth=0 blks |
| 132 | +naming =version 2 bsize=4096 ascii-ci=0 ftype=0 |
| 133 | +log =internal bsize=4096 blocks=43113, version=2 |
| 134 | + = sectsz=4096 sunit=1 blks, lazy-count=1 |
| 135 | +realtime =none extsz=4096 blocks=0, rtextents=0 |
| 136 | +``` |
| 137 | + |
| 138 | +```bash |
| 139 | +> yum list installed | grep dotnet |
| 140 | +dotnet-host.x86_64 2.1.0_preview2_26411_07-1 @packages-microsoft-com-prod |
| 141 | +dotnet-hostfxr-2.0.3.x86_64 2.0.3-1 @packages-microsoft-com-prod |
| 142 | +dotnet-hostfxr-2.0.5.x86_64 2.0.5-1 @packages-microsoft-com-prod |
| 143 | +dotnet-hostfxr-2.0.7.x86_64 2.0.7-1 @packages-microsoft-com-prod |
| 144 | +dotnet-hostfxr-2.1.0-preview2-26406-04.x86_64 |
| 145 | +dotnet-hosting-2.0.7.x86_64 2.0.7-1 @packages-microsoft-com-prod |
| 146 | +dotnet-runtime-2.0.3.x86_64 2.0.3-1 @packages-microsoft-com-prod |
| 147 | +dotnet-runtime-2.0.5.x86_64 2.0.5-1 @packages-microsoft-com-prod |
| 148 | +dotnet-runtime-2.0.7.x86_64 2.0.7-1 @packages-microsoft-com-prod |
| 149 | +dotnet-runtime-2.1.0-preview2-26406-04.x86_64 |
| 150 | +dotnet-runtime-deps-2.1.0-preview2-26406-04.x86_64 |
| 151 | +dotnet-sdk-2.0.3.x86_64 2.0.3-1 @packages-microsoft-com-prod |
| 152 | +dotnet-sdk-2.1.105.x86_64 2.1.105-1 @packages-microsoft-com-prod |
| 153 | +dotnet-sdk-2.1.300-preview2-008533.x86_64 |
| 154 | +dotnet-sdk-2.1.4.x86_64 2.1.4-1 @packages-microsoft-com-prod |
| 155 | +``` |
| 156 | + |
| 157 | +```bash |
| 158 | +> dotnet --version |
| 159 | +2.1.300-preview2-008533 |
| 160 | +``` |
0 commit comments