0

Steps to reproduce

Create net461 Core webproject referencing ClassLibrary of same 4.6.1 in VS2017. In lib define

public class X
{
    [Required] // using System.ComponentModel.DataAnnotations;
    public bool Q { get; set; }
}

In webapp use it: new ClassLibrary1.X();

Builds in VS, builds via msbuild in cmd, OK.

Run dotnet restore, dotnet build and you will get

Class1.cs(5,14): error CS0234: The type or namespace name 'Net' does not exist in the namespace 'System' (are you missing an assembly reference?) [C:\Users\xxx\Documents\Visual Studio 2017\Projects\coretest\ClassLibrary1\ClassLibrary1.csproj]

C:\Program Files\dotnet\sdk\1.0.0\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.targets(92,5): error : Cannot find project info for 'C:\Users\xxx\Documents\Visual Studio 2017\Projects\coretest\ClassLibrary1\ClassLibrary1.csproj'. This can indicate a missing project reference. [C:\Users\xxx\Documents\Visual Studio 2017\Projects\coretest\WebApplication1\WebApplication1.csproj]

dotnet --info output: .NET Command Line Tools (1.0.0)

Product Information: Version: 1.0.0 Commit SHA-1 hash: e53429feb4

Runtime Environment: OS Name: Windows OS Version: 10.0.14393 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.0

smg
  • 1,096
  • 2
  • 11
  • 27

0 Answers0