Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to run dnx console App

I have followed this link to run a dnx console app. I created two files Program.cs and project.json with the content as mentioned in the link

Here is the sequence of commands that i executed

    F:\first-dnx> dnvm list

    Active Version           Runtime Architecture OperatingSystem Alias
    ------ -------           ------- ------------ --------------- -----
           1.0.0-beta6       clr     x86          win
           1.0.0-beta6       coreclr x64          win
      *    1.0.0-beta8-15530 clr     x86          win             default

F:\first-dnx> dnu restore
Microsoft .NET Development Utility CLR-x86-1.0.0-beta8-15530

Restoring packages for F:\first-dnx\project.json
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/
  CACHE https://www.nuget.org/api/v2/
Writing lock file F:\first-dnx\project.lock.json
Restore complete, 490ms elapsed

NuGet Config files used:
    C:\Users\sam\AppData\Roaming\NuGet\NuGet.Config

Feeds used:
    https://www.myget.org/F/aspnetvnext/api/v2/
    https://www.nuget.org/api/v2/
F:\first-dnx> dnu build

The project got built successfully but when i am trying to run the app below exception is thrown

F:\first-dnx> dnx . run
System.InvalidOperationException: Unable to load application or execute command '.'. Available commands: ConsoleApp1.
   at Microsoft.Dnx.ApplicationHost.Program.ThrowEntryPointNotfoundException(DefaultHost host, String applicationName, Exception innerException)
   at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args)
   at Microsoft.Dnx.ApplicationHost.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
   at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework)
F:\first-dnx> dnx . ConsoleApp1
System.InvalidOperationException: Unable to load application or execute command '.'. Available commands: ConsoleApp1.
   at Microsoft.Dnx.ApplicationHost.Program.ThrowEntryPointNotfoundException(DefaultHost host, String applicationName, Exception innerException)
   at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args)
   at Microsoft.Dnx.ApplicationHost.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
   at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework)
F:\first-dnx>
like image 747
Sameer Avatar asked Jan 08 '23 15:01

Sameer


1 Answers

You don't have to add the . to specify the base path anymore. Try:

dnx run

This was changed in beta7. See: https://github.com/aspnet/Announcements/issues/52.

like image 184
Henk Mollema Avatar answered Feb 05 '23 07:02

Henk Mollema