Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framework-level build options not used to determine if a project is runnable #6196

Closed
natemcmaster opened this issue May 20, 2016 · 2 comments
Milestone

Comments

@natemcmaster
Copy link
Contributor

Steps to reproduce

{
  "frameworks": {
    "netcoreapp1.0": {
      "buildOptions": {
        "emitEntryPoint": true
      },
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.0.0-*"
        }
      }
    },
    "netstandard1.5": {
      "dependencies": {
        "NETStandard.Library": "1.5.0-*"
      }
    }
  }
}

dotnet run

Expected behavior

"Hello world"

Actual behavior

App is not runnable. dotnet run dies with

Expect required library libhostpolicy.dylib to be present in [/private/tmp/runnable/bin/Debug/netcoreapp1.0]
  - This may be because of an invalid .NET Core FX configuration in the directory.

Workaround

Add a top-level build option with emitEntryPoint = true (and override in other TFMs buildOptions/emitEntryPoint = false).

{
   "buildOptions": {
      "emitEntryPoint": true
  },
  "frameworks": {
    "netcoreapp1.0": {
      "buildOptions": {
        "emitEntryPoint": true
      },

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 RID:         osx.10.11-x64
@patjknott
Copy link

This workaround worked for me. I created a solution in .NET Core, Created a new project repository for classes that referenced an interface inside the original solution. Found main causing problems, set the emitEntryPoint to false, and the dependencyName : target: project parameters... now my solution works...

@TheRealPiotrP
Copy link
Contributor

This is fixed in csproj. OutputType can be conditioned on TargetFramework.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the 1.0.0-rtm milestone Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants