sdk: Can't build for net46 (net451, net452 works fine)

Steps to reproduce

Use the https://github.com/aspnet/cli-samples/tree/master/HelloMvc sample. Add net46 as the target framework Restore (restores fine) Build (dotnet build -f net46)

Expected behavior

Project builds successfully

Actual behavior

PS C:\Source\cli-samples\HelloMvc> dotnet build -f net46
Project HelloMvc (.NETFramework,Version=v4.6) will be compiled because expected outputs are missing
Compiling HelloMvc for .NETFramework,Version=v4.6
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Diagnostics.FileVersionInfo >= 4.0.0-rc2-24027 could not be resolved.
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Diagnostics.StackTrace >= 4.0.1-rc2-24027 could not be resolved.
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Text.Encoding.CodePages >= 4.0.1-rc2-24027 could not be resolved.
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Threading.Thread >= 4.0.0-rc2-24027 could not be resolved.
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Xml.XmlDocument >= 4.0.1-rc2-24027 could not be resolved.
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Xml.XPath.XDocument >= 4.0.1-rc2-24027 could not be resolved.

Compilation failed.
    0 Warning(s)
    6 Error(s)

Time elapsed 00:00:00.0945403

Note when targeting net451 or net452 the project builds just fine.

Environment data

dotnet --info output:

PS C:\Source\cli-samples\HelloMvc> dotnet --info
.NET Command Line Tools (1.0.0-rc2-002670)

Product Information:
 Version:     1.0.0-rc2-002670
 Commit Sha:  f0018642a9

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks, @moozzyk. I came back to Core after 8-10 months. It seems I need to go to release notes and docs etc.

  1. It works just fine for net451 and net452
  2. Microsoft.NetCore.App is specific to netcoreapp1.0:
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.0-*",
          "type": "platform"
        }
      },
      "imports": [
        "portable-net45+wp80+win8+wpa81+dnxcore50",
        "portable-net451+win8"
      ]
    },
    "net46": {}
  },
  1. If I did not separate Microsoft.NETCore.App - the error I get does not tell me that Microsoft.NETCore.App is causing the problem so the experience is bad.