dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.71k stars 1.06k forks source link

dotnet run DirectoryNotFoundException #5004

Closed marono closed 4 years ago

marono commented 8 years ago

Hi,

dotnet run seems to be looking for a file bin\Debug\dnx46\myProject.exe which is not there as the build output is in .dotnetrun\<GUID>.

I've got compilationOptions.emitEntryPoint set to true.

Thanks,

blackdwarf commented 8 years ago

@marono can you share your project.json? Also, what is the verions of the tools you are using? This is on Windows, correct?

marono commented 8 years ago

@blackdwarf I was building the sources @ 1e45e35d2070b50b7a51adea96a5158f7b49dc9d It generated version 1.0.0-beta-001150.

Just to make sure, is the expectation that the sequence would be:

dotnet restore
dotnet build
dotnet run

or should

dotnet restore
dotnet run

sufice ?

My understanding is that the latter is perfectly valid, but the behavior seems to indicates a build is required as well.

Here's my project.json:

{
  "version": "0.0.1-alpha0",
  "description": "SomeService.Host",
  "compilationOptions": {
    "emitEntryPoint": true,
    "warningsAsErrors": true
  },
  "configurations": {
    "Debug": {
      "compilationOptions": {
        "optimize": false
      }
    },
    "Release": {
      "compilationOptions": {
        "optimize": true
      }
    }
  },
  "dependencies": {
    "System.Runtime": "4.0.21-*",
    "log4net.Ext.Json.1.2.13": "1.2.13.20140804",
    "Topshelf": "3.3.1",
    "Topshelf.Log4Net": "3.3.1",
    "Owin": "1.0.0",
    "Microsoft.AspNet.WebApi.Core": "5.2.3",
    "Microsoft.Owin.Hosting": "3.0.1",
    "Microsoft.Owin.Host.HttpListener": "3.0.1",
    "Microsoft.Extensions.Configuration": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
    "NewRelic.WebApi2.Owin": "2.0.0",
    "Autofac": "4.0.0-*",
    "Autofac.Owin": "4.0.0-*",
    "Autofac.WebApi2.Owin": "4.0.0-*",
    "Purplelight.Framework.Autofac.Integration.WebApi": "0.2.2",
    "Swashbuckle.Core": "5.2.2",
    "Microsoft.Owin.Diagnostics": "3.0.1",
    "Microsoft.AspNet.WebApi.Client": "5.2.3",
    "Microsoft.AspNet.Mvc.DataAnnotations": "6.0.0-*"
  },
  "frameworks": {
    "dnx46": {
      "dependencies": {
      },
      "frameworkAssemblies": {
        "System.Xml": "4.0.0",
        "System.Net.Http": "4.0.0"
      }
    }
  },
  "commands": {
    "start": "SomeService.Host"
  }
}

Regards,

blackdwarf commented 8 years ago

@marono does this still repro with the latest bits?

marono commented 8 years ago

@blackdwarf haven' tried it recently, I will do so and report back

marono commented 8 years ago

@blackdwarf can't reproduce it with the current version. I'll close the issue.

Regards,