sdk: net451 - Failed to make the following project runnable

Description

I have ported an open-source .Net library MaxMind.Db-Reader to .Net Core. There are three projects in the solution:

  • MaxMind.Db - Library
  • MaxMind.Db.Benchmark - Executable
  • MaxMind.Db.Test - Executable

URL to .Net Core port branch: https://github.com/am11/MaxMind-DB-Reader-dotnet/tree/coreclr-port

Locally, with RID: win10-x86, I have latest DNX and latest CLI (5 hours old) installed; all three projects compile, Benchmark and Test executables run for two TFMs: netstandard1.0 and net451.

When deployed to AppVeyor CI (see appveyor.yml; modified variant of @enricosada’s script: dotnet/sdk#5496), it builds all three project with netstandard1.4 for lib and netcoreapp1.0 for exes, but the exe (Benchmark and Test projects) build fails for net451.

Here is the AppVeyor build log: https://ci.appveyor.com/project/am11/maxmind-db-reader-dotnet/build/1.0.39/job/7no4jns5isw4mn27#L1245

Steps to reproduce

git clone https://github.com/am11/MaxMind-DB-Reader-dotnet -b coreclr-port --recursive

cd MaxMind-DB-Reader-dotnet

git checkout 22eace3

dotnet restore

dotnet -v build -c Debug -f net451 .\MaxMind.Db.Test

Expected behavior

Successfully compiles a lib and two executable projects for both TFMs: net451 and netcoreapp1.0.

Actual behavior

  • Successfully compiles a lib and two executable projects for TFMs netcoreapp1.0.

  • Successfully compiles a lib for TFM net451.

  • Fails to compile two executable projects for TFM net451 with the following error:

    Failed to make the following project runnable

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-rc2-002659)

Product Information: Version: 1.0.0-rc2-002659 Commit Sha: 11a001706f

Runtime Environment: OS Name: Windows OS Version: 6.3.9600 OS Platform: Windows RID: win81-x64

About this issue

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

Most upvoted comments

Still no update? RTM is out and I am still seeing this issue.

This issue has been mitigated with latest 1.0.0-rc4-004767. I tested with following steps:

  • Downloaded https://dotnetcli.blob.core.windows.net/dotnet/Sdk/rel-1.0.0/dotnet-dev-win-x64.latest.zip and extracted at c:\temp\dotnet-cli.

  • Then, we first migrate the project and build the csproj:

    cd \temp\dotnet-cli
    git clone https://github.com/maxmin/Maxmind-DB-Reader-dotnet --recursive
    cd Maxmind-DB-Reader-dotnet
    git checkout 822b6c5
    :: we have xproj and project.json in this revision
    
    :: migration will delete project.json and global.json, convert xproj->csproj and update the
    :: .sln file accordingly. The process will also create a `.\backup` with old project files.
    ..\dotnet migrate
    
    :: restore and build
    ..\dotnet restore
    ..\dotnet build -c Debug -f net45  MaxMind.Db.Benchmark
    :: succeeds!
    
    :: Microsoft (R) Build Engine version 15.1.545.13942
    :: Copyright (C) Microsoft Corporation. All rights reserved.
    
    ::   MaxMind.Db -> C:\temp\foodoo\Maxmind-DB-Reader-dotnet\MaxMind.Db\bin\Debug\net45\MaxMind.Db.dll
    ::   MaxMind.Db.Benchmark -> C:\temp\foodoo\Maxmind-DB-Reader-dotnet\MaxMind.Db.Benchmark\bin\Debug\net45\MaxMind.Db.Benchmark.exe
    
    :: Build succeeded.
    ::     0 Warning(s)
    ::     0 Error(s)
    
    :: Time Elapsed 00:00:02.15
    
    :: let's run it
    ..\dotnet run -c Debug -f net45 -p .\MaxMind.Db.Benchmark\MaxMind.Db.Benchmark.csproj MaxMind.Db.Benchmark\GeoLite2-City.mmdb
    
    :: it works! :)
    

Thanks and kudo’s to CLI team for fixing this! 🎉

/cc @oschwald

@piotrpMSFT, should this issue be closed as fixed?

my issue it was using -o parameter if i provide fullpath including configuration, framework and runtime on output parameter, the error is gone ex:

dotnet build -c Release -o .\bin\Release\net461\win7-x64 -f net461
dotnet build -c Debug -o .\bin\Debug\net461\win7-x64 -f net461
dotnet build -c Debug -o .\bin\Debug\net451\win7-x64 -f net451

@piotrpMSFT: What is the resolution here?