Bug 1400976

Summary: s2i build fails when the project is also targeting net451
Product: dotNET Reporter: Tom Deseyn <tdeseyn>
Component: rh-dotnetcore10-containerAssignee: Severin Gehwolf <sgehwolf>
Status: CLOSED ERRATA QA Contact: jiri vanek <jvanek>
Severity: unspecified Docs Contact: Les Williams <lwilliam>
Priority: unspecified    
Version: 1.0CC: bgollahe, dbhole, kanderso, lzachar, omajid, sgehwolf, zzambers
Target Milestone: ga   
Target Release: 1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rh-dotnetcore10-docker-1.0-13 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-20 08:24:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Tom Deseyn 2016-12-02 13:26:14 UTC
Description of problem:
s2i build fails when the project is also targeting net451
e.g.
  "frameworks": {
    "net451": {},
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.1",
          "type": "platform"
        }
      }
    }

Actual results:
Project src (.NETFramework,Version=v4.5.1) will be compiled because expected outputs are missing
Compiling src for .NETFramework,Version=v4.5.1
/opt/app-root/src/project.json(56,15): error DOTNET1012: The reference assemblies directory was not specified. You can set the location using the DOTNET_REFERENCE_ASSEMBLIES_PATH environment variable.
/opt/app-root/src/project.json(36,35): error NU1001: The dependency mscorlib could not be resolved.
/opt/app-root/src/project.json(36,35): error NU1001: The dependency mscorlib could not be resolved.
/opt/app-root/src/project.json(45,39): error NU1001: The dependency System could not be resolved.
/opt/app-root/src/project.json(46,50): error NU1001: The dependency System could not be resolved.
/opt/app-root/src/project.json(36,35): error NU1001: The dependency System could not be resolved.
/opt/app-root/src/project.json(37,58): error NU1001: The dependency System could not be resolved.

Expected results:
Only perform operations for netcoreapp1.0 framework.
The framework can be specified explicitly on the command line.
dotnet build -f netcoreapp1.0

Comment 1 Omair Majid 2016-12-02 19:32:35 UTC
Tom, could you make an automated test case out of this that we could add to https://github.com/redhat-developer/s2i-dotnetcore ?

Comment 2 Omair Majid 2016-12-02 20:33:33 UTC
I created a sample project that targets netcoreapp1.0.

  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.1.0",
          "type": "platform"
        }
      }
    }

This builds fine with .NET Core 1.1's `dotnet build` but fails to build with `dotnet build -f netcoreapp1.1`. Is this a bad side-effect of the proposed change or a PEBKAC?

The following builds fine under .NET Core 1.1 using both `dotnet build` and `dotnet build -f netcoreapp1.1`:

  "frameworks": {
    "netcoreapp1.1": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.1.0",
          "type": "platform"
        }
      }
    }

Comment 3 Omair Majid 2016-12-02 22:47:24 UTC
Patch posted for review: https://github.com/redhat-developer/s2i-dotnetcore/pull/11

Comment 7 errata-xmlrpc 2017-03-20 08:24:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0560