dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.73k stars 1.07k forks source link

"dotnet build" fails for new "Lib" project on Windows 2016 Nano #6390

Closed ericeil closed 4 years ago

ericeil commented 8 years ago

Steps to reproduce

Set global nuget.config to this: https://gist.github.com/mellinoe/7580563f9850466ac44352d2b1972c7c On Windows 2016 Nano, create a new "lib" project, restore it, and build it:

[40.78.96.241]: PS C:\l1> C:\dotnet\dotnetnano\dotnet new -t Lib Created new C# project in C:\l1. [40.78.96.241]: PS C:\l1> C:\dotnet\dotnetnano\dotnet restore log : Restoring packages for C:\l1\project.json... log : Writing lock file to disk. Path: C:\l1\project.lock.json log : C:\l1\project.json log : Restore completed in 175ms. [40.78.96.241]: PS C:\l1> C:\dotnet\dotnetnano\dotnet build Project l1 (.NETStandard,Version=v1.6) will be compiled because expected outputs are missing Compiling l1 for .NETStandard,Version=v1.6 C:\dotnet\dotnetnano\dotnet : C:\dotnet\dotnetnano\dotnet.exe compile-csc @C:\l1\obj\Debug\netstandard1.6\dotnet-compile.rsp returned Exit Code 1

C:\l1\obj\Debug\netstandard1.6\dotnet-compile.assemblyinfo.cs(2,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) C:\l1\obj\Debug\netstandard1.6\dotnet-compile.assemblyinfo.cs(3,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) C:\l1\obj\Debug\netstandard1.6\dotnet-compile.assemblyinfo.cs(4,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) C:\l1\obj\Debug\netstandard1.6\dotnet-compile.assemblyinfo.cs(5,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) C:\l1\obj\Debug\netstandard1.6\dotnet-compile.assemblyinfo.cs(2,58): error CS0518: Predefined type 'System.String' is not defined or imported C:\l1\obj\Debug\netstandard1.6\dotnet-compile.assemblyinfo.cs(3,54): error CS0518: Predefined type 'System.String' is not defined or imported C:\l1\obj\Debug\netstandard1.6\dotnet-compile.assemblyinfo.cs(4,67): error CS0518: Predefined type 'System.String' is not defined or imported C:\l1\obj\Debug\netstandard1.6\dotnet-compile.assemblyinfo.cs(5,62): error CS0518: Predefined type 'System.String' is not defined or imported C:\l1\Library.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?) C:\l1\Library.cs(5,18): error CS0518: Predefined type 'System.Object' is not defined or imported C:\l1\Library.cs(7,16): error CS0518: Predefined type 'System.Void' is not defined or imported

Expected behavior

Build should work

Actual behavior

Build fails due to unresolved type references.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-003024)

Product Information:
 Version:            1.0.0-preview2-003024
 Commit SHA-1 hash:  ef4a8e85ef

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14300
 OS Platform: Windows
 RID:         win10-x64
ericeil commented 8 years ago

Not specific to Nano; I got the same result on Win7.

C:\l1>dotnet --info
.NET Command Line Tools (1.0.0-preview2-003032)

Product Information:
 Version:            1.0.0-preview2-003032
 Commit SHA-1 hash:  a3447617f9

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.1.7601
 OS Platform: Windows
 RID:         win7-x64
blackdwarf commented 8 years ago

@ericeil we've merged in a change to this template this morning. Can you try the latest and see if it still repros?

TheRealPiotrP commented 8 years ago

Putting in backlog for now. @ericeil if this still repros for you please move back to no milestone. Otherwise, please close.

ericeil commented 8 years ago

Thanks, the latest bits do seem to fix this.